Update CI #1156
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: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Undergo Prerequisite | |
uses: ./.github/actions/prerequisite | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- 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: Undergo Prerequisite | |
uses: ./.github/actions/prerequisite | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust Nightly | |
if: matrix.rust == 'nightly' | |
uses: ./.github/actions/install-rust-nightly | |
with: | |
version: ${{ env.RUSTUP_NIGHTLY_VERSION }} | |
- 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: Undergo Prerequisite | |
uses: ./.github/actions/prerequisite | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust Nightly | |
uses: ./.github/actions/install-rust-nightly | |
with: | |
version: ${{ env.RUSTUP_NIGHTLY_VERSION }} | |
- name: Run Tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all --all-features |