Skip to content

Commit

Permalink
Run tests in CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpacaaa authored Sep 7, 2023
1 parent 38856ce commit 4d271a8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Test

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Set up Rust cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: borgo-${{ hashFiles('**/Cargo.lock') }}

- name: Build compiler
run: |
nix develop --command \
cargo build
- name: Run Test suite
run: |
nix develop --command \
just test-runner
- name: Check snapshots haven't updated
run: |
if [[ `git status --porcelain` ]]; then
echo "Some files have changed, forgot to update snapshots?"
git diff
exit 1
fi

0 comments on commit 4d271a8

Please sign in to comment.