Nx CI #2
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: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
install-deps: | |
name: Install Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- uses: actions/setup-node@v3 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- name: npm install | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci --no-scripts | |
lint: | |
name: Linting and Formatting | |
runs-on: ubuntu-latest | |
needs: install-deps | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- run: npx nx format:check --base main | |
- run: npx nx affected --target=lint --parallel | |
test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
needs: install-deps | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- run: npx nx affected --target=test --parallel |