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
|
|
|
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-05-01 08:58:50 +00:00
|
|
|
run: cargo clippy --all-features --all-targets -- -D warnings -A clippy::items_after_test_module
|
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
|
2023-01-09 22:21:31 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2022-11-17 02:53:35 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
2023-01-20 16:00:18 +00:00
|
|
|
- name: Build node
|
|
|
|
run: |
|
|
|
|
cd substrate/node
|
|
|
|
cargo build
|
|
|
|
|
2022-07-29 14:36:09 +00:00
|
|
|
- name: Run Tests
|
2023-01-31 15:48:19 +00:00
|
|
|
run: GITHUB_CI=true cargo test --all-features
|
2022-07-22 16:31:29 +00:00
|
|
|
|
|
|
|
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-22 16:31:29 +00:00
|
|
|
- name: Install rustfmt
|
2023-01-09 22:21:31 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2022-07-22 16:31:29 +00:00
|
|
|
with:
|
2022-09-17 08:37:43 +00:00
|
|
|
toolchain: ${{ steps.nightly.outputs.version }}
|
2022-07-22 16:31:29 +00:00
|
|
|
components: rustfmt
|
|
|
|
|
|
|
|
- name: Run rustfmt
|
2022-09-17 08:40:50 +00:00
|
|
|
run: cargo +${{ steps.nightly.outputs.version }} fmt -- --check
|