Skip to content

Add matrix to test every supported rancher version #494

Add matrix to test every supported rancher version

Add matrix to test every supported rancher version #494

Workflow file for this run

name: Unit tests
on:
pull_request:
schedule:
- cron: '0 2 * * *'
jobs:
unit-tests:
strategy:
fail-fast: false
max-parallel: 3
matrix:
rancher_version:
- head
- v2.9-head
- v2.10-head
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
env:
NODE_VERSION: current
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Deploy rancher
run: npm run start-rancher
env:
RANCHER_VERSION: ${{ matrix.rancher_version }}
- name: Build package from the current branch
run: npm run build-npm
- name: Run e2e tests
run: npm run start-unit-tests
env:
RANCHER_VERSION: ${{ matrix.rancher_version }}
- name: Upload Cypress screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots-${{ matrix.rancher_version }}
path: cypress/screenshots
retention-days: 7
if-no-files-found: ignore
- name: Upload Cypress videos
# Test run video is always captured, so this action uses "always()" condition
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-videos-${{ matrix.rancher_version }}
path: cypress/videos
retention-days: 7