2026-02-22 16:01:02 -08:00

61 lines
1.5 KiB
YAML

name: CI
on:
push:
branches:
- main
paths-ignore:
- "**README.md"
- ".gitignore"
- "LICENSE"
pull_request:
branches:
- main
paths-ignore:
- "**README.md"
- ".gitignore"
- "LICENSE"
jobs:
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
# Cache the Nim compiler built by nimbus-build-system (NBS).
# Building Nim from source is the slowest part of `make update`.
# Keyed on the NBS submodule commit — auto-invalidates when NBS is bumped.
- id: nbs
run: echo "hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: vendor/nimbus-build-system/vendor/Nim
key: ${{ runner.os }}-nbs-${{ steps.nbs.outputs.hash }}
- run: make update
- run: make all
test:
name: Test
needs: build
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- id: nbs
run: echo "hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: vendor/nimbus-build-system/vendor/Nim
key: ${{ runner.os }}-nbs-${{ steps.nbs.outputs.hash }}
- run: make update
- run: make tests