Setup repo for nightly builds testing #3289
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
release: | |
types: [published] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
RUST_VERSION: 1.78.0 | |
jobs: | |
lint-toml-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
- name: Install Cargo.toml linter | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: cargo-toml-lint | |
version: "0.1.1" | |
- name: Run Cargo.toml linter | |
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: | |
[ | |
"airdrop", | |
"AMM", | |
"english-auction", | |
"counter-script", | |
"DAO", | |
"escrow", | |
"fundraiser", | |
"TicTacToe", | |
"name-registry", | |
"NFT", | |
"native-asset", | |
"fractional-NFT", | |
"oracle", | |
"OTC-swap-predicate", | |
".devops/.template", | |
"timelock", | |
] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: clippy, rustfmt | |
- name: Init cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install Fuel toolchain | |
uses: FuelLabs/[email protected] | |
with: | |
toolchain: nightly | |
date: 2024-05-28 | |
- name: Check Sway formatting | |
run: | | |
cd ${{ matrix.project }} | |
forc fmt --check | |
- name: Check Rust formatting | |
run: | | |
cargo fmt --verbose --check | |
- name: Build Sway | |
run: | | |
cd ${{ matrix.project }} | |
forc build --locked | |
- name: Build Rust files | |
run: | | |
cargo build --locked --package "${{ matrix.project }}*" | |
- name: Check Clippy Linter | |
run: | | |
cargo clippy --all-features --all-targets -- -D warnings --package "${{ matrix.project }}*" | |
- name: Run Rust tests | |
run: | | |
cargo test --locked | |
- name: Run Sway tests | |
run: | | |
cd ${{ matrix.project }} | |
forc test | |
contributing-book: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: [".docs/contributing-book/src/code"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
- name: Init cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install Fuel toolchain | |
uses: FuelLabs/[email protected] | |
with: | |
toolchain: nightly | |
date: 2024-05-28 | |
- name: Check Sway formatting | |
run: cd ${{ matrix.project }} && forc fmt --check | |
- name: Build Sway | |
run: cd ${{ matrix.project }} && forc build --locked |