Skip to content

Unit Tests

Unit Tests #1164

Workflow file for this run

name: Unit Tests
on:
workflow_dispatch:
schedule:
- cron: '0 21 * * *'
pull_request:
branches:
- main
jobs:
unit-test:
if: github.repository_owner == 'rancher'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Setup Nodejs and npm
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
- name: Setup yarn
run: npm install -g yarn
- name: Setup Nodejs with yarn caching
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
cache: yarn
- name: Install dependencies
run: yarn
- name: Run tests
run: |
yarn test:ci
mkdir -p coverage-artifacts/coverage/unit
cp coverage/unit/coverage-final.json coverage-artifacts/coverage/coverage-unit.json
- name: Upload coverage
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{github.run_number}}-${{github.run_attempt}}-coverage
path: coverage-artifacts/**/*