Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository as a workspace and CI #28

Merged
merged 4 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading