open-swe/.github/workflows/unit-tests.yml
Brace Sproul 4a851a05ea
ci: Add CI actions (#972)
* ci: Add CI actions

* cr

* cr

* cr
2026-02-23 19:11:41 -08:00

50 lines
1.2 KiB
YAML

# This workflow will run unit tests for the current project
name: Unit Tests
permissions:
contents: read
on:
push:
branches: ["main"]
paths:
- "apps/web/**"
- "packages/shared/**"
- "*"
- ".*"
pull_request:
paths:
- "apps/web/**"
- "packages/shared/**"
- "*"
- ".*"
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
name: Unit Tests
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build project
run: yarn build
- name: Run tests
run: yarn test