feat: add support for Angular 19 #342
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
NX_CLOUD_DISTRIBUTED_EXECUTION: false | |
NX_TASKS_RUNNER: local | |
MATRIX_SIZE: 1 | |
jobs: | |
install-deps: | |
name: Install and cache dependencies | |
runs-on: ubuntu-latest | |
outputs: | |
node-version: ${{ steps.setup-node.outputs.node-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
id: setup-node | |
with: | |
node-version-file: '.nvmrc' | |
# Rebase must happen before installing dependencies. | |
- name: Rebase current branch | |
run: node ./scripts/rebase-pr.js | |
- name: Cache node modules | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: npm install | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Start Nx Cloud CI run | |
run: | | |
if [ $MATRIX_SIZE -gt 1 ]; then | |
npx nx-cloud start-ci-run | |
else | |
echo "Nx Cloud CI run not started because MATRIX_SIZE is $MATRIX_SIZE" | |
fi | |
- name: Agent list | |
run: | | |
echo 'matrix_size=${{ env.MATRIX_SIZE }}' >> $GITHUB_OUTPUT | |
node -e 'console.log("agents=" + JSON.stringify({ agent: Array.from(Array(${{ env.MATRIX_SIZE }}).keys()).map(i => i + 1) }))' >> $GITHUB_OUTPUT | |
agents: | |
name: Bootup Nx Cloud agent | |
if: needs.install-deps.outputs.matrix_size > 1 | |
runs-on: ubuntu-latest | |
needs: install-deps | |
strategy: | |
matrix: ${{ fromJSON(needs.install-deps.outputs.agents) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve node_modules cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ needs.install-deps.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Start Nx Agent ${{ matrix.agent }} | |
run: npx nx-cloud start-agent | |
lint: | |
name: Lint | |
needs: install-deps | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
# Rebase must happen before installing dependencies. | |
- name: Rebase current branch | |
run: node ./scripts/rebase-pr.js | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v3 | |
- name: Retrieve node_modules cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ needs.install-deps.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Check library dependencies | |
run: npx skyux-dev check-lib-dependencies | |
- name: Check library missing peers | |
run: npx skyux-dev check-lib-missing-peers | |
- name: Check library resources | |
run: npx skyux-dev check-lib-resources | |
- name: Check code formatting | |
run: npx prettier --check . | |
- name: Run lint | |
run: npx nx affected:lint --quiet --silent --parallel=${{ env.MATRIX_SIZE }} | |
build: | |
name: Build | |
needs: install-deps | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
# Rebase must happen before installing dependencies. | |
- name: Rebase current branch | |
run: node ./scripts/rebase-pr.js | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v3 | |
- name: Retrieve node_modules cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ needs.install-deps.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Build | |
run: npx nx affected --target=build --parallel=${{ env.MATRIX_SIZE }} | |
build-dist: | |
name: Build packages distribution | |
needs: install-deps | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
# Rebase must happen before installing dependencies. | |
- name: Rebase current branch | |
run: node ./scripts/rebase-pr.js | |
- name: Retrieve node_modules cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ needs.install-deps.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Build packages dist | |
run: npx skyux-dev create-packages-dist | |
coverage: | |
name: Code coverage | |
needs: install-deps | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
# Rebase must happen before installing dependencies. | |
- name: Rebase current branch | |
run: node ./scripts/rebase-pr.js | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v3 | |
- name: Retrieve node_modules cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ needs.install-deps.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Code coverage | |
run: | | |
npx nx affected --target=test,posttest --configuration=ci --parallel=${{ env.MATRIX_SIZE }} | |
stop-agents: | |
name: Stop Nx Cloud agents | |
runs-on: ubuntu-latest | |
if: needs.install-deps.outputs.matrix_size > 1 | |
needs: [install-deps, lint, build, build-dist, coverage] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Retrieve node_modules cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ needs.install-deps.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Stop Nx Cloud agents | |
run: npx nx-cloud stop-all-agents |