Skip to content

Commit 2f724dc

Browse files
committed
Add build & test workflow
1 parent 2b255b2 commit 2f724dc

File tree

13 files changed

+14667
-4769
lines changed

13 files changed

+14667
-4769
lines changed

.github/workflows/build_test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build & Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: '16'
17+
- run: npm install
18+
- run: npm run build
19+
20+
test:
21+
runs-on: ubuntu-latest
22+
needs: build
23+
env:
24+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
25+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: '16'
31+
32+
- uses: actions/setup-python@v3
33+
with:
34+
python-version: '3.x'
35+
36+
- uses: actions/checkout@v3
37+
with:
38+
repository: flackr/wpt
39+
path: wpt
40+
ref: inject-polyfill
41+
42+
- name: Setup WPT
43+
run: |
44+
cd wpt
45+
pip install virtualenv
46+
./wpt make-hosts-file | sudo tee -a /etc/hosts
47+
48+
- name: Run Tests
49+
run: |
50+
npm install
51+
npm run serve &
52+
./wpt/wpt manifest
53+
./wpt/wpt serve &
54+
npm test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
build
1+
dist
22
node_modules

jest.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Copyright 2021 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
14+
export default {
15+
preset: 'ts-jest/presets/default-esm',
16+
extensionsToTreatAsEsm: ['.ts'],
17+
globals: {
18+
'ts-jest': {
19+
useESM: true,
20+
},
21+
},
22+
testEnvironment: 'node',
23+
globalSetup: '<rootDir>/tests/jest-setup.ts',
24+
globalTeardown: '<rootDir>/tests/jest-teardown.ts',
25+
roots: ['tests'],
26+
};

0 commit comments

Comments
 (0)