Testing & Pipeline Automations #3
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: Unit Tests | |
on: | |
pull_request: | |
push: | |
branches: [main, alpha] | |
jobs: | |
test: | |
runs-on: macos-latest | |
permissions: | |
# Required to checkout the code | |
contents: read | |
# Required to put a comment into the pull-request | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v4 | |
id: cache-node-modules | |
with: | |
path: | | |
./node_modules | |
./web/node_modules | |
./cli/node_modules | |
./worker/node_modules | |
./shared/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Run Unit Tests | |
run: CI="true" yarn test:cov | |
- name: Report Coverage | |
if: github.event_name == 'pull_request' | |
uses: davelosert/vitest-coverage-report-action@v2 |