Update CI #1144
Workflow file for this run
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
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
name: continuous-integration-main | ||
env: | ||
RUSTUP_NIGHTLY_VERSION: nightly-2024-02-09 | ||
RUST_BACKTRACE: full | ||
# Make sure CI fails on all warnings, including Clippy lints | ||
RUSTFLAGS: "-Dwarnings" | ||
jobs: | ||
build-check: | ||
name: Check Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prerequisites | ||
uses: ./.github/actions/prerequisites | ||
- name: Check Build | ||
run: | | ||
bash ./scripts/cmd-all build check | ||
cargo-clippy: | ||
name: Run Clippy and Format Checks | ||
needs: build-check | ||
if: needs.build-check.result == 'success' | ||
strategy: | ||
max-parallel: 2 | ||
matrix: | ||
rust: [ stable, nightly ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prerequisites | ||
uses: ./.github/actions/prerequisites | ||
- name: Use cargo.toml with polkadot-sdk fork | ||
# To make sure that our polkadot-sdk fork will be used | ||
run: | | ||
rm /home/runner/work/spacewalk/spacewalk/Cargo.toml | ||
mv /home/runner/work/spacewalk/spacewalk/Cargo_CI.toml /home/runner/work/spacewalk/spacewalk/Cargo.toml | ||
- name: Install Rust Nightly | ||
if: matrix.rust == 'nightly' | ||
uses: ./.github/actions/install-rust-nightly | ||
- name: Rustfmt | ||
if: matrix.rust == 'nightly' | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
toolchain: ${{ RUSTUP_NIGHTLY_VERSION }} | ||
Check failure on line 54 in .github/workflows/ci-main.yml
|
||
command: fmt | ||
args: --all -- --check | ||
- name: Clippy for Tests and Examples | ||
if: matrix.rust == 'nightly' | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
toolchain: ${{ RUSTUP_NIGHTLY_VERSION }} | ||
command: clippy | ||
args: --all-features --tests --benches --examples -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references | ||
- name: Clippy -- Libraries and Binaries | ||
if: matrix.rust == 'stable' | ||
run: | | ||
bash ./scripts/cmd-all clippy "clippy --lib --bins" "-- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references" | ||
cargo-test: | ||
name: Run Tests | ||
needs: build-check | ||
if: needs.build-check.result == 'success' | ||
runs-on: ubuntu-latest | ||
env: | ||
SOURCE_STELLAR_SECRET_MAINNET: ${{ secrets.SOURCE_STELLAR_SECRET_MAINNET }} | ||
SOURCE_STELLAR_SECRET_TESTNET: ${{ secrets.SOURCE_STELLAR_SECRET_TESTNET }} | ||
DEST_STELLAR_SECRET_MAINNET: ${{ secrets.DEST_STELLAR_SECRET_MAINNET }} | ||
DEST_STELLAR_SECRET_TESTNET: ${{ secrets.DEST_STELLAR_SECRET_TESTNET }} | ||
steps: | ||
- name: Prerequisites | ||
uses: ./.github/actions/prerequisites | ||
- name: Install Rust Nightly | ||
if: matrix.rust == 'nightly' | ||
uses: ./.github/actions/install-rust-nightly | ||
- name: Run Tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all --all-features |