Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Dec 15, 2023
1 parent 9149ed5 commit 98444b9
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set rust version
run: |
source ci/rust-version.sh
echo "RUST_STABLE=$rust_stable" | tee -a $GITHUB_ENV
# The toolchain action should definitely be run before the cache action
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_STABLE }}
components: rustfmt, clippy
cache: false
# avoid the default "-D warnings" which thrashes cache
rustflags: ""

# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run fmt+clippy
run: |
cargo fmt --all --check
cargo clippy --workspace --all-targets
- name: Build
run: |
cargo build --all-targets

0 comments on commit 98444b9

Please sign in to comment.