hoc/.github/workflows/rust.yml

96 lines
2.1 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
2022-10-11 09:42:41 +02:00
uses: actions/checkout@v3
2019-11-25 16:53:06 +01:00
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
2019-11-25 16:53:06 +01:00
override: true
components: rustfmt
2019-11-25 16:53:06 +01:00
- name: Check Formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
2022-10-11 09:42:41 +02:00
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
- name: Cache cargo registry, index and build directory
2022-10-11 09:42:41 +02:00
uses: actions/cache@v3
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
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
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
2022-10-11 09:42:41 +02:00
uses: actions/checkout@v3
2019-11-25 16:53:06 +01:00
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
2019-11-25 16:53:06 +01:00
override: true
- name: Cache cargo registry, index and build directory
2022-10-11 09:42:41 +02:00
uses: actions/cache@v3
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
uses: actions-rs/cargo@v1
with:
command: test