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

Porting code #38

Closed
wants to merge 10 commits into from
Closed
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
188 changes: 188 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
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

orderbook-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 contract

- name: Build Sway
run: |
cd "contract"
forc build --locked

tests:
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 "contract"
forc build --locked

- name: Check Rust formatting
run: cargo fmt --verbose --check --manifest-path tests/Cargo.toml

- name: Check Clippy Linter
run: cargo clippy --manifest-path tests/Cargo.toml --all-features --all-targets -- -D warnings

- name: Run Rust tests
run: cargo test --locked --manifest-path tests/Cargo.toml

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 "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

utils:
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: Build Rust files
run: cargo build --locked --manifest-path utils/Cargo.toml

- name: Check Clippy Linter
run: cargo clippy --manifest-path utils/Cargo.toml --all-features --all-targets -- -D warnings

scripts:
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 "contract"
forc build --locked

- name: Build Rust files
run: cargo build --locked --manifest-path scripts/Cargo.toml

- name: Check Clippy Linter
run: cargo clippy --manifest-path scripts/Cargo.toml --all-features --all-targets -- -D warnings
Loading
Loading