hoc/.github/workflows/rust.yml

77 lines
1.8 KiB
YAML
Raw Normal View History

2022-10-11 09:42:41 +02:00
on:
workflow_call:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 0 * * *"
2019-09-09 21:39:16 +02:00
jobs:
rustfmt:
name: Rustfmt
2019-09-09 21:39:16 +02:00
runs-on: ubuntu-latest
2019-11-25 16:53:06 +01:00
steps:
- name: Checkout sources
uses: actions/checkout@v4
2019-11-25 16:53:06 +01:00
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
2019-11-25 16:53:06 +01:00
- name: Check Formatting
run: cargo fmt --all -- --check
2019-11-25 16:53:06 +01:00
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry, index and build directory
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
2022-10-11 09:42:41 +02:00
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2019-11-25 16:53:06 +01:00
- name: Clippy Linting
2023-07-27 10:37:23 +02:00
run: cargo clippy --all-features -- -Dclippy::all -Dclippy::pedantic
- name: Clippy Test Linting
2023-07-27 10:37:23 +02:00
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
2019-11-25 16:53:06 +01:00
2019-11-25 16:53:06 +01:00
test:
name: Test Suite
2019-11-25 16:53:06 +01:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
# add windows-latest when it is clear why tests are failing
2021-03-29 12:55:49 +02:00
# os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
2019-09-09 21:39:16 +02:00
steps:
2019-11-25 16:53:06 +01:00
- name: Checkout sources
uses: actions/checkout@v4
2019-11-25 16:53:06 +01:00
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
2019-11-25 16:53:06 +01:00
- name: Cache cargo registry, index and build directory
uses: actions/cache@v4
2019-11-25 16:53:06 +01:00
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
2022-10-11 09:42:41 +02:00
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2019-11-25 16:53:06 +01:00
- name: Run Tests
run: cargo test