luau-unzip/.github/workflows/ci.yml
Erica Marigold c1d10d37df
chore(actions): run all test suites, not just extract
Fixes an extra suite argumenta added to the test runner command, which
told it to only run tests located in the extraction module.
2025-02-24 08:19:27 +00:00

122 lines
3.4 KiB
YAML

name: CI
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'examples/**'
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
actions: write
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: nixbuild/nix-quick-install-action@v29
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 5368709000
purge: true
purge-prefixes: cache-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
- name: Cache pesde data
uses: actions/cache@v4
with:
path: ~/.pesde
key: pesde-${{ runner.os }}-${{ hashFiles('pesde.toml') }}
- name: Install dependencies
run: nix develop -c pesde install --locked
- name: Check formatting
run: nix develop -c lune run fmt -- --check
typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: nixbuild/nix-quick-install-action@v29
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 5368709000
purge: true
purge-prefixes: cache-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
- name: Cache pesde data
uses: actions/cache@v4
with:
path: ~/.pesde
key: pesde-${{ runner.os }}-${{ hashFiles('pesde.toml') }}
- name: Install dependencies
run: nix develop -c pesde install --locked
- name: Setup lune typedefs
run: nix develop -c lune setup
- name: Typecheck
run: nix develop -c lune run typecheck
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: nixbuild/nix-quick-install-action@v29
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 5368709000
purge: true
purge-prefixes: cache-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
- name: Cache pesde data
uses: actions/cache@v4
with:
path: ~/.pesde
key: pesde-${{ runner.os }}-${{ hashFiles('pesde.toml') }}
- name: Install dependencies
run: nix develop -c pesde install --locked
- name: Run tests
run: |
# HACK: Since the exit code isn't properly reflected due to frktest not returning
# the correct status on test fails, we have to parse the output and check ourselves
output="$(nix develop -c lune run tests | tee /dev/stderr)"
tail -n 1 <<< $output | sed 's/\x1b\[[0-9;]*m//g' | grep -q "status: OK"