open-swe/.github/workflows/unit-tests.yml
Brace Sproul 0923c8b47e
fix: running tests and in ci (#536)
* fix: running tests and in ci

* cr

* cr

* cr

* exit 0 when no tests

* cr
2025-07-27 19:11:34 +00:00

40 lines
1.1 KiB
YAML

# This workflow will run unit tests for the current project
name: Unit Tests
permissions:
contents: read
on:
push:
branches: ["main"]
pull_request:
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