try to use also cache (same as in runTest) #25
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: Run the cypress component tests | |
on: | |
push: | |
branches: | |
- master | |
- 20** | |
- v20** | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Find component directory | |
id: find_component_dir | |
run: echo "COMPONENT_DIR=$(find . -type d -name 'META-INF' -exec dirname {} \;)" >> $GITHUB_ENV | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22.x' | |
cache: 'npm' | |
- name: Cache + Restore node_modules | |
uses: actions/cache@v4 | |
with: | |
# Cache node_modules and Puppeteer chrome | |
path: | | |
~/.cache | |
.angular | |
node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install and run the cypress component tests | |
working-directory: ${{ env.COMPONENT_DIR }} | |
run: | | |
npm install | |
npm run cy:run | |
- name: Upload artifacts on failure | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts | |
path: ${{ env.COMPONENT_DIR }}/cypress/screenshots/** | |
if-no-files-found: ignore | |
retention-days: 30 | |