Skip to content

Commit

Permalink
Add a Github workflow to run the tests on push
Browse files Browse the repository at this point in the history
  • Loading branch information
jgilchrist committed Oct 16, 2024
1 parent 14e7657 commit 1f34edf
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches:
- master

jobs:

metadata:
runs-on: ubuntu-latest

outputs:
rust-version: ${{ steps.determine-rust-version.outputs.version }}

steps:
- uses: actions/checkout@v4

- id: determine-rust-version
name: Determine Rust version
run: |
version=$(grep -m 1 'rust-version' Cargo.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)
echo "Rust version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
build-and-test:
runs-on: ubuntu-latest
needs: [metadata]

steps:
- uses: actions/checkout@v4

- name: Setup toolchain
run: |
rustup override set ${{ needs.metadata.outputs.rust-version }}
- name: Test
run: |
cargo test --release

0 comments on commit 1f34edf

Please sign in to comment.