2022-07-22 16:31:29 +00:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
pull_request:
|
2022-10-01 03:26:40 +00:00
|
|
|
workflow_dispatch:
|
2022-07-22 16:31:29 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-09-17 08:37:43 +00:00
|
|
|
- name: Get nightly version to use
|
|
|
|
id: nightly
|
2022-10-22 02:19:01 +00:00
|
|
|
run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT
|
2022-09-17 08:37:43 +00:00
|
|
|
|
2022-07-23 11:05:31 +00:00
|
|
|
- name: Build Dependencies
|
|
|
|
uses: ./.github/actions/build-dependencies
|
2022-07-22 16:31:29 +00:00
|
|
|
with:
|
2023-01-01 09:09:10 +00:00
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-09-17 08:37:43 +00:00
|
|
|
# Clippy requires nightly due to serai-runtime requiring it
|
|
|
|
rust-toolchain: ${{ steps.nightly.outputs.version }}
|
2022-07-29 14:36:09 +00:00
|
|
|
rust-components: clippy
|
2022-07-22 16:31:29 +00:00
|
|
|
|
|
|
|
- name: Run Clippy
|
2023-01-01 09:18:23 +00:00
|
|
|
run: cargo clippy --all-features --tests -- -D warnings -A dead_code
|
2022-07-22 16:31:29 +00:00
|
|
|
|
2022-11-17 02:53:35 +00:00
|
|
|
deny:
|
2022-07-22 16:31:29 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-11-17 02:53:35 +00:00
|
|
|
|
2022-12-02 18:38:30 +00:00
|
|
|
- name: Advisory Cache
|
2022-11-17 02:53:35 +00:00
|
|
|
uses: actions/cache@v3
|
2022-07-22 16:31:29 +00:00
|
|
|
with:
|
2022-11-17 02:53:35 +00:00
|
|
|
path: ~/.cargo/advisory-db
|
|
|
|
key: rust-advisory-db
|
|
|
|
|
|
|
|
- name: Install cargo
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
|
|
|
|
- name: Install cargo deny
|
|
|
|
run: cargo install --locked cargo-deny
|
|
|
|
|
|
|
|
- name: Run cargo deny
|
|
|
|
run: cargo deny -L error --all-features check
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-07-22 16:31:29 +00:00
|
|
|
|
2022-07-29 14:36:09 +00:00
|
|
|
- name: Test Dependencies
|
|
|
|
uses: ./.github/actions/test-dependencies
|
2023-01-01 09:09:10 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-07-22 16:31:29 +00:00
|
|
|
|
2022-07-29 14:36:09 +00:00
|
|
|
- name: Run Tests
|
2022-07-22 16:31:29 +00:00
|
|
|
run: cargo test --all-features
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-09-17 08:37:43 +00:00
|
|
|
- name: Get nightly version to use
|
|
|
|
id: nightly
|
2022-10-22 02:19:01 +00:00
|
|
|
run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT
|
2022-09-17 08:37:43 +00:00
|
|
|
|
2022-07-29 14:36:09 +00:00
|
|
|
# Doesn't grab the cache as it's not needed
|
2022-07-22 16:31:29 +00:00
|
|
|
- name: Install rustfmt
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-09-17 08:37:43 +00:00
|
|
|
toolchain: ${{ steps.nightly.outputs.version }}
|
2022-07-22 16:31:29 +00:00
|
|
|
profile: minimal
|
|
|
|
components: rustfmt
|
|
|
|
|
|
|
|
- name: Run rustfmt
|
2022-09-17 08:40:50 +00:00
|
|
|
run: cargo +${{ steps.nightly.outputs.version }} fmt -- --check
|