Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- run: grunt check
working-directory: ./scripts
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: npm install
- run: grunt check
working-directory: ./scripts
build-matrix:
name: Build matrix for unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: read-matrix
name: Read build matrix
run: echo "::set-output name=matrix::`jq -c . test/unit/config/run_matrix.json`"
outputs:
matrix: ${{ steps.read-matrix.outputs.matrix }}
unit-test:
needs: build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
browser: [ChromeWithFlags, FirefoxWithFlags]
include:
- os: windows-latest
browser: EdgeWithFlags
matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix)[github.event_name] }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- name: Run test cases
env:
BROWSER: ${{matrix.browser}}
run: npm run unittest
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: npm install
- name: Run test cases
env:
BROWSER: ${{ matrix.browser }}
run: npm run unittest
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
},
"scripts": {
"postinstall": "cd scripts && grunt prepare",
"unittest": "node ./node_modules/karma/bin/karma start test/unit/karma/ci.config.js"
"unittest": "node ./node_modules/karma/bin/karma start test/unit/config/karma.config.js"
}
}
34 changes: 34 additions & 0 deletions test/unit/config/run_matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"push": {
"os": [
"ubuntu-latest",
"windows-latest",
"macos-latest"
],
"browser": [
"ChromeWithFlags",
"FirefoxWithFlags"
],
"include": [
{
"os": "windows-latest",
"browser": "EdgeWithFlags"
}
]
},
"pull_request": {
"os": [
"ubuntu-latest"
],
"browser": [
"ChromeWithFlags",
"FirefoxWithFlags"
],
"include": [
{
"os": "windows-latest",
"browser": "EdgeWithFlags"
}
]
}
}