Skip to content

Update CI

Update CI #1149

Workflow file for this run

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: Checkout Repository
uses: actions/checkout@v4
- name: Free up disk space
uses: ./.github/actions/free-up-disk-space
- name: Other Installations
uses: ./.github/actions/installations
- 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: Checkout Repository
uses: actions/checkout@v4
- name: Free up disk space
uses: ./.github/actions/free-up-disk-space
- 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: ${{ env.RUSTUP_NIGHTLY_VERSION }}
command: fmt
args: --all -- --check
- name: Clippy for Tests and Examples
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
toolchain: ${{ env.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: Checkout Repository
uses: actions/checkout@v4
- name: Free up disk space
uses: ./.github/actions/free-up-disk-space
- 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