Skip to content

Commit

Permalink
chore: Primary CI on Node.js 18 (merge #1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal authored Feb 8, 2024
2 parents d5b31d9 + 217e947 commit 7eebe9d
Show file tree
Hide file tree
Showing 39 changed files with 1,459 additions and 7,062 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Browser Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
browser-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Build artifacts
run: yarn build
- name: Install browser test dependencies
working-directory: browser-test
run: npm ci
- name: Install Playwright Browsers
working-directory: browser-test
run: npx playwright install --with-deps
- name: Run Playwright tests
working-directory: browser-test
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: browser-test-report
path: browser-test/playwright-report/
retention-days: 30
58 changes: 6 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node-version: [18.x]
platform: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node-version: [18.x]
platform: [ubuntu-latest, windows-latest]

steps:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node-version: [18.x]
platform: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node-version: [18.x]
platform: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -258,52 +258,6 @@ jobs:
- name: Run yarn test262
run: exit 0 # TODO remove test262 from required tests for CI

integration-test:
name: integration-test

# begin macro

runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
node-version: [16.x]
platform: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Echo node version
run: node --version

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache npm modules
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn --frozen-lockfile

# end macro

- name: Run build-pre-release-test
run: ./scripts/build-pre-release-test.sh

- name: Run yarn test:pre-release
run: cd packages/ses-integration-test && yarn test:pre-release

platform-compatibility-test:
name: platform-compatibility-test

Expand All @@ -313,7 +267,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node-version: [18.x]
platform: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -367,7 +321,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node-version: [18.x]
platform: [ubuntu-latest]

steps:
Expand Down
5 changes: 5 additions & 0 deletions browser-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
7 changes: 7 additions & 0 deletions browser-test/assets/endo-bundled-ses.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<title>Testing</title>
<script src="../../packages/ses/dist/ses.umd.js"></script>
<script>
lockdown();
document.querySelector('title').innerText = 'Pass';
</script>
15 changes: 15 additions & 0 deletions browser-test/debug-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const path = require('path');
const http = require('http');
const handler = require('serve-handler');

const config = {
public: path.resolve(__dirname, '..'),
};

const server = http.createServer((request, response) =>
handler(request, response, config));

server.listen(0, '127.0.0.1', () => {
const { port } = server.address();
console.log(`http://127.0.0.1:${port}`);
});
205 changes: 205 additions & 0 deletions browser-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions browser-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "browser-test",
"private": true,
"author": "Endo Contributors",
"license": "Apache-2.0",
"scripts": {
"test": "playwright test"
},
"devDependencies": {
"serve-handler": "^6.1.5",
"@playwright/test": "^1.41.2",
"@types/node": "^20.11.16"
}
}
Loading

0 comments on commit 7eebe9d

Please sign in to comment.