Merge pull request #11050 from tschaub/parallel-test-jobs
Run rendering and spec tests in parallel
This commit is contained in:
102
.github/workflows/test.yml
vendored
102
.github/workflows/test.yml
vendored
@@ -12,8 +12,8 @@ env:
|
|||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
pretest:
|
||||||
name: Node ${{ matrix.node }} / ${{ matrix.os }}
|
name: Pre-Test (Node ${{ matrix.node }} / ${{ matrix.os }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@@ -33,18 +33,108 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
|
|
||||||
- run: node --version
|
- name: Determine Cache Directory
|
||||||
- run: npm --version
|
id: npm-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
|
|
||||||
|
- name: Configure Job Cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: npm test
|
run: npm run pretest
|
||||||
|
|
||||||
|
spec:
|
||||||
|
name: Spec (Node ${{ matrix.node }} / ${{ matrix.os }})
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
node:
|
||||||
|
- 14
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js Version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
|
||||||
|
- name: Determine Cache Directory
|
||||||
|
id: npm-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
|
|
||||||
|
- name: Configure Job Cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: npm run test-spec
|
||||||
|
|
||||||
|
rendering:
|
||||||
|
name: Rendering (Node ${{ matrix.node }} / ${{ matrix.os }})
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
node:
|
||||||
|
- 14
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js Version
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
|
||||||
|
- name: Determine Cache Directory
|
||||||
|
id: npm-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
|
|
||||||
|
- name: Configure Job Cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: npm run test-rendering
|
||||||
|
|
||||||
- name: Store Rendering Test Artifacts
|
- name: Store Rendering Test Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: rendering-tests
|
name: rendering-tests
|
||||||
path: rendering/cases/
|
path: rendering/cases/**/actual.png
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
"lint": "eslint tasks test rendering src/ol examples config",
|
"lint": "eslint tasks test rendering src/ol examples config",
|
||||||
"pretest": "npm run lint && npm run typecheck",
|
"pretest": "npm run lint && npm run typecheck",
|
||||||
"test-rendering": "node rendering/test.js",
|
"test-rendering": "node rendering/test.js",
|
||||||
"test": "npm run karma -- --single-run --log-level error && npm run test-rendering -- --force",
|
"test-spec": "npm run karma -- --single-run --log-level error",
|
||||||
|
"test": "npm run test-spec && npm run test-rendering -- --force",
|
||||||
"karma": "karma start test/karma.config.js",
|
"karma": "karma start test/karma.config.js",
|
||||||
"start": "npm run serve-examples",
|
"start": "npm run serve-examples",
|
||||||
"serve-examples": "webpack-dev-server --config examples/webpack/config.js --mode development --watch",
|
"serve-examples": "webpack-dev-server --config examples/webpack/config.js --mode development --watch",
|
||||||
|
|||||||
Reference in New Issue
Block a user