Skip to content

Commit

Permalink
Repository as a workspace and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Braqzen authored Apr 10, 2024
2 parents 7994c36 + 6207f79 commit 8ffcf2a
Show file tree
Hide file tree
Showing 30 changed files with 648 additions and 1,014 deletions.
142 changes: 142 additions & 0 deletions .github/workflows/ci.yml
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
Loading

0 comments on commit 8ffcf2a

Please sign in to comment.