-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
648 additions
and
1,014 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
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.75.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 | ||
|
||
market-contract: | ||
runs-on: ubuntu-latest | ||
|
||
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-02-07 | ||
|
||
- name: Check Sway formatting | ||
run: forc fmt --check --path market-contract | ||
|
||
- name: Check Rust formatting | ||
run: cargo fmt --verbose --check --manifest-path market-contract/Cargo.toml | ||
|
||
- name: Build Sway | ||
run: | | ||
cd "market-contract" | ||
forc build --locked | ||
- name: Build Rust files | ||
run: cargo build --locked --manifest-path market-contract/Cargo.toml | ||
|
||
- name: Check Clippy Linter | ||
run: cargo clippy --manifest-path market-contract/Cargo.toml --all-features --all-targets -- -D warnings | ||
|
||
- name: Run Rust tests | ||
run: cargo test --locked --manifest-path market-contract/Cargo.toml | ||
|
||
CLI: | ||
runs-on: ubuntu-latest | ||
|
||
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-02-07 | ||
|
||
- name: Build Sway | ||
run: | | ||
cd "market-contract" | ||
forc build --locked | ||
- name: Build Rust files | ||
run: cargo build --locked --manifest-path spark-cli/Cargo.toml | ||
|
||
- name: Check Clippy Linter | ||
run: cargo clippy --manifest-path spark-cli/Cargo.toml --all-features --all-targets -- -D warnings | ||
|
||
SDK: | ||
runs-on: ubuntu-latest | ||
|
||
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-02-07 | ||
|
||
- name: Build Sway | ||
run: | | ||
cd "market-contract" | ||
forc build --locked | ||
- name: Build Rust files | ||
run: cargo build --locked --manifest-path spark-market-sdk/Cargo.toml | ||
|
||
- name: Check Clippy Linter | ||
run: cargo clippy --manifest-path spark-market-sdk/Cargo.toml --all-features --all-targets -- -D warnings |
Oops, something went wrong.