deps(repo): Bump actions/setup-node from 3 to 4 #87
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: Node.js CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v3 | |
- name: Install Cypress dependencies | |
run: sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Update NPM | |
run: npm install -g npm@">=7" | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Cache Cypress binary | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/Cypress | |
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npx nx affected --target=build | |
- name: Lint core files | |
run: npm run lint-core | |
- name: Lint packages | |
run: npx nx affected --target=lint | |
- name: Nx integrity check | |
run: npx nx workspace-lint | |
- name: Set up xvfb for Cypress | |
run: | | |
Xvfb -screen 0 1024x768x24 :99 & | |
echo "DISPLAY=:99" >> $GITHUB_ENV | |
- name: Unit tests | |
run: npx nx affected --target=test | |
- name: End to end tests | |
run: npx nx affected --target e2e |