mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-23 20:19:24 +00:00
22713493d8
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: "recursive"
|
|
|
|
- name: Get nightly version to use
|
|
id: nightly
|
|
run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build Dependencies
|
|
uses: ./.github/actions/build-dependencies
|
|
with:
|
|
# Clippy requires nightly due to serai-runtime requiring it
|
|
rust-toolchain: ${{ steps.nightly.outputs.version }}
|
|
rust-components: clippy
|
|
|
|
- name: Run Clippy
|
|
run: cargo clippy --all-features -- -D warnings -A clippy::type_complexity -A dead_code
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: "recursive"
|
|
|
|
- name: Test Dependencies
|
|
uses: ./.github/actions/test-dependencies
|
|
|
|
- name: Run Tests
|
|
run: cargo test --all-features
|
|
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Get nightly version to use
|
|
id: nightly
|
|
run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT
|
|
|
|
# Doesn't grab the cache as it's not needed
|
|
- name: Install rustfmt
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ steps.nightly.outputs.version }}
|
|
profile: minimal
|
|
components: rustfmt
|
|
|
|
- name: Run rustfmt
|
|
run: cargo +${{ steps.nightly.outputs.version }} fmt -- --check
|