Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in CI #2

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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