Add node engine >=21 #1101
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
name: Packages CI | |
on: | |
push: | |
branches: | |
- '**' | |
paths: | |
- packages/** | |
- .github/workflows/packages.yml | |
- jest.config.ts | |
- jest.preset.js | |
- .eslintrc.json | |
- .prettierrc | |
- package.json | |
- package-lock.json | |
tags-ignore: | |
- vault-v* | |
- armory-v* | |
- policy-engine-v* | |
jobs: | |
build-and-test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add .npmrc | |
if: ${{ !startsWith(github.head_ref, 'dependabot/') }} | |
run: echo "${{ secrets.NPMRC }}" > .npmrc | |
- name: Install node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '21' | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
make install/ci | |
- name: Track origin/main | |
if: github.ref != 'refs/heads/main' | |
run: 'git branch --track main origin/main' | |
- name: Set base and head SHAs for nx affected | |
uses: nrwl/nx-set-shas@v3 | |
- name: Code format | |
run: | | |
npx nx affected --target format:check lint:check \ | |
--exclude tag:type:application,armory-e2e-testing \ | |
--base=origin/main | |
- name: Test types | |
run: | | |
npx nx affected --target test:type \ | |
--exclude tag:type:application,armory-e2e-testing \ | |
--base=origin/main | |
- name: Test unit | |
run: | | |
npx nx affected --target test:unit \ | |
--exclude tag:type:application,armory-e2e-testing \ | |
--base=origin/main | |
- name: Test integration | |
run: | | |
npx nx affected --target test:integration \ | |
--exclude tag:type:application,armory-e2e-testing \ | |
--base=origin/main | |
- name: Test end-to-end | |
run: | | |
# TODO: (@wcalderipe, 19/06/24) Ignore the SDK user journeys test as | |
# it requires a running server. Ideally, once we've got Docker images | |
# for each part of the stack, we can switch the storage to something | |
# in-memory. It'd be a good time to revisit this TODO and think about | |
# using testcontainers. | |
npx nx affected --target test:e2e \ | |
--exclude tag:type:application,armory-e2e-testing \ | |
--base=origin/main \ | |
--testPathIgnorePatterns=packages/armory-sdk/src/lib/__test__/e2e/* | |
- name: Send Slack notification on failure | |
if: failure() && github.ref == 'refs/heads/main' | |
uses: 8398a7/action-slack@v3 | |
with: | |
username: GitHub | |
author_name: 'Packages CI failed' | |
status: ${{ job.status }} | |
fields: message,commit,author | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |