From 11fd473bf68fa52c3f077aa4f25e34a586709de4 Mon Sep 17 00:00:00 2001 From: Simon van Noort <50550612+Noorts@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:10:35 +0100 Subject: [PATCH] Add Rust workflow (#31) * Add Rust test workflow * Remove explicit build step * Add cargo caching * Adjust workflow steps order * Upgrade to `actions/cache@v3` --- .github/workflows/rust.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..1708cd5 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,38 @@ +name: Rust Test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + # Setup Rust environment + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + # Cache dependencies and build outputs + - name: Cache cargo registry + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + # Test Rust project + - name: Test Rust project + run: | + cd rust + cargo test --release