Merge develop
into release branch
#5050
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
pull_request: | |
types: [ labeled ] | |
push: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
format: | |
name: Format | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install build tools | |
run: ./scripts/init.sh | |
# TODO(#1125): Use actions-rs/install for Taplo once stable | |
# - uses: actions-rs/[email protected] | |
# with: | |
# crate: taplo-cli | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v1 | |
- name: Format | |
run: ./scripts/tests/format.sh --check | |
checks: | |
name: Checks | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
scripts: [ | |
"clippy", | |
"parachain", | |
"standalone" | |
] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Free up disk space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
- name: Install build tools | |
run: ./scripts/init.sh | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Checks | |
run: ./scripts/tests/${{ matrix.scripts }}.sh | |
benchmark: | |
name: Quick check benchmarks | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Free up disk space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
- name: Install build tools | |
run: ./scripts/init.sh | |
- run: ./scripts/benchmarks/quick_check.sh | |
test_standalone: | |
name: Test standalone build | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Free up disk space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
- name: Install build tools | |
run: ./scripts/init.sh | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v1 | |
- name: Tests | |
run: ./scripts/tests/test_standalone.sh | |
test_parachain: | |
name: Test parachain build | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Free up disk space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
- name: Install build tools | |
run: ./scripts/init.sh | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v1 | |
- name: Tests | |
run: ./scripts/tests/test_parachain.sh | |
fuzz: | |
name: Fuzz | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Free up disk space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
- name: Install build tools | |
run: ./scripts/init.sh | |
- uses: actions-rs/[email protected] | |
with: | |
crate: cargo-fuzz | |
use-tool-cache: true | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v1 | |
- run: ./scripts/tests/fuzz.sh --verbose |