hoc/.github/workflows/rust.yml

98 lines
2.3 KiB
YAML
Raw Normal View History

2019-11-25 16:53:06 +01:00
on: [push, pull_request]
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@v2
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: Cache cargo registry, index and build directory
uses: actions/cache@v2
2019-11-25 16:53:06 +01:00
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
2020-11-23 14:36:43 +01:00
key: rustfmt-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
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
uses: actions/checkout@v2
- 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
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
2020-11-23 14:36:43 +01:00
key: clippy-${{ 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
os: [ubuntu-latest, macos-latest]
2019-09-09 21:39:16 +02:00
steps:
2019-11-25 16:53:06 +01:00
- name: Checkout sources
uses: actions/checkout@v2
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
uses: actions/cache@v2
2019-11-25 16:53:06 +01:00
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
2020-11-23 14:36:43 +01:00
key: test-${{ 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