-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(actions): centralize setup actions and update third-party actions
- Loading branch information
1 parent
ee9bfd6
commit 06f49d4
Showing
2 changed files
with
26 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: 'Setup' | ||
description: 'Common setup steps for all jobs' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v4 | ||
- run: npm ci | ||
shell: bash | ||
- run: npx --no-install nx run-many --target=build --parallel=4 | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,55 +12,31 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npm ci | ||
- run: npx nx run-many --target=build --parallel=4 | ||
- uses: './.github/actions/setup' | ||
|
||
diff: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npm ci | ||
# by making this job depend on the build job, the following line should be | ||
# 100% cache hits; The nx cache seems to be much easier to use than the | ||
# GitHub artifact action. | ||
- run: npx nx run-many --target=build --parallel=4 | ||
- uses: './.github/actions/setup' | ||
- run: ./scripts/diff-lint | ||
|
||
lint: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npm ci | ||
# by making this job depend on the build job, the following line should be | ||
# 100% cache hits; The nx cache seems to be much easier to use than the | ||
# GitHub artifact action. | ||
- run: npx nx run-many --target=build --parallel=4 | ||
- uses: './.github/actions/setup' | ||
- run: npx nx workspace-lint | ||
- run: npx nx format:check | ||
- run: npm run lint | ||
|
@@ -93,19 +69,10 @@ jobs: | |
# need to be release, so 60 is not unreasonable. | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npm ci | ||
# by making this job depend on the build job, the following line should be | ||
# 100% cache hits; The nx cache seems to be much easier to use than the | ||
# GitHub artifact action. | ||
- run: npx nx run-many --target=build --parallel=4 | ||
- uses: './.github/actions/setup' | ||
- run: | | ||
npm config set workspaces-update false | ||
npx multi-semantic-release \ | ||
|
@@ -136,24 +103,15 @@ jobs: | |
nodeCount: [5] | ||
nodeIndex: [0, 1, 2, 3, 4] | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure AWS credentials from Test account | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npm ci | ||
# by making this job depend on the build job, the following line should be | ||
# 100% cache hits; The nx cache seems to be much easier to use than the | ||
# GitHub artifact action. | ||
- run: npx nx run-many --target=build --parallel=4 | ||
- uses: './.github/actions/setup' | ||
- uses: check-run-reporter/[email protected] | ||
id: split | ||
with: | ||
|
@@ -196,19 +154,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npm ci | ||
# by making this job depend on the build job, the following line should be | ||
# 100% cache hits; The nx cache seems to be much easier to use than the | ||
# GitHub artifact action. | ||
- run: npx nx run-many --target=build --parallel=4 | ||
- uses: './.github/actions/setup' | ||
- run: npm test -- --selectProjects 'Unit Tests' | ||
- uses: check-run-reporter/[email protected] | ||
if: ${{ always() }} | ||
|