mirror of https://github.com/Qiskit/qiskit.org.git
Parallelize jobs in GitHub Actions (#1173)
This commit is contained in:
parent
5b84eabf1a
commit
8311efb69e
|
@ -1,14 +1,26 @@
|
|||
name: lint, test, and build
|
||||
name: CI
|
||||
|
||||
# run when action is manually triggered
|
||||
# or when a pull request is made
|
||||
on: [workflow_dispatch, pull_request]
|
||||
|
||||
jobs:
|
||||
# job id/key
|
||||
lint-test-and-build:
|
||||
# job name
|
||||
name: Lint, Test, and Build
|
||||
lint:
|
||||
name: Lint
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "14.x"
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
|
||||
test:
|
||||
name: Test
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
|
@ -17,19 +29,25 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Node ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
check-latest: true
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm test
|
||||
|
||||
build:
|
||||
name: Build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm run generate
|
||||
|
|
Loading…
Reference in New Issue