Merge pull request #10 from Jorciney/renovate/ngrx-monorepo #245
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'] | |
workflow_dispatch: | |
inputs: {} | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.10.0] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
restore-keys: node-${{ matrix.node-version }}- | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci | |
build: | |
needs: prepare | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.10.0] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules from cache | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: npm run build --verbose | |
test: | |
needs: prepare | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.10.0] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules from cache | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- run: npm test | |
e2e-test: | |
needs: prepare | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:latest | |
options: --user 1001 | |
strategy: | |
matrix: | |
node-version: [20.10.0] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules from cache | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
- uses: cypress-io/github-action@v6 | |
with: | |
install: true | |
start: | | |
npm start | |
wait-on: http://localhost:4200 | |
wait-on-timeout: 1200 | |
project: e2e | |
working-directory: . | |
browser: chrome | |
config: pageLoadTimeout=100000,baseUrl=http://localhost:4200 | |
- name: Upload video artifact | |
# if: failure() # This will only run if the previous step fails | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cypress-videos | |
path: dist/cypress |