Skip to content

Replace thiserror with derive_more::Display #2275

Replace thiserror with derive_more::Display

Replace thiserror with derive_more::Display #2275

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
merge_group:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.72.0
NIGHTLY_RUST_VERSION: nightly-2023-08-28
jobs:
check-changelog:
name: Check Changelog
runs-on: ubuntu-latest
steps:
- uses: tarides/changelog-check-action@v2
with:
changelog: CHANGELOG.md
cargo:
needs:
- check-changelog
runs-on: buildjet-4vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix:
include:
- command: clippy
args: --all-targets --all-features -- -D warnings -D clippy::dbg_macro
- command: check
args: --all-targets
- command: check
args: --all-targets -p fuel-asm
- command: check
args: --all-targets -p fuel-crypto
- command: check
args: --all-targets -p fuel-merkle
- command: check
args: --all-targets -p fuel-storage
- command: check
args: --all-targets -p fuel-tx
- command: check
args: --all-targets -p fuel-types
- command: check
args: --all-targets -p fuel-vm
- command: check
args: --all-targets --no-default-features
- command: check
args: --all-targets --all-features
- command: check
args: --target thumbv6m-none-eabi -p fuel-asm -p fuel-crypto -p fuel-storage -p fuel-merkle --no-default-features
- command: check
args: --target wasm32-unknown-unknown -p fuel-crypto --no-default-features
- command: check
args: --target wasm32-unknown-unknown -p fuel-tx --features serde --no-default-features
- command: check
args: --target wasm32-unknown-unknown -p fuel-types --features serde --no-default-features
- command: rustc
args: --target wasm32-unknown-unknown -p fuel-types --features typescript --crate-type=cdylib
- command: rustc
args: --target wasm32-unknown-unknown -p fuel-asm --features typescript --crate-type=cdylib
- command: check
args: --target wasm32-unknown-unknown -p fuel-types --features serde --no-default-features
- command: check
args: --target wasm32-unknown-unknown -p fuel-vm --features alloc --no-default-features
- command: bench
args: --workspace --no-run
- command: make
args: check
- command: test
args: --all-targets --all-features
- command: test
args: --all-targets --no-default-features
- command: test
args: --all-targets --no-default-features --features serde
- command: test
args: --all-targets --no-default-features --features alloc
- command: test
args: --all-targets --features random
- command: test
args: --all-targets --features serde
- command: test
args: --all-targets --features random,profile-gas,profile-coverage,serde
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
targets: "thumbv6m-none-eabi,riscv32imac-unknown-none-elf,wasm32-unknown-unknown"
components: "clippy"
- name: Install Cargo Make
uses: davidB/rust-cargo-make@v1
with:
version: "0.36.4"
- run: cargo ${{ matrix.command }} ${{ matrix.args }}
rustfmt:
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY_RUST_VERSION }}
components: rustfmt
- name: Rustfmt check
run: cargo +${{ env.NIGHTLY_RUST_VERSION }} fmt --all -- --check
cargo-toml-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: setup binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install Cargo.toml linter
run: cargo binstall --no-confirm cargo-sort
- name: Run Cargo.toml sort check
run: cargo sort -w --check
verifications-complete:
needs:
- rustfmt
- cargo
- cargo-toml-fmt-check
runs-on: ubuntu-latest
steps:
- run: true
publish-check:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Publish crate check
uses: katyo/publish-crates@v2
with:
dry-run: true
publish:
# Only do this job if publishing a release and all checks pass.
needs:
- verifications-complete
- publish-check
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Verify tag version
run: |
curl -sSLf "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -L -o dasel && chmod +x dasel
mv ./dasel /usr/local/bin/dasel
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} Cargo.toml
- name: Publish crate
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo_audit:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
publish_wasm_packages:
needs:
- publish
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
targets: "wasm32-unknown-unknown"
- name: Installing required crates
run: cargo install wasm-bindgen-cli wasm-opt
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8.6.9
- name: Setup Node
uses: actions/setup-node@v3
with:
cache: "pnpm"
node-version: 18.14.1
node-version-file: ".npm/package.json"
cache-dependency-path: ".npm/pnpm-lock.yaml"
registry-url: 'https://registry.npmjs.org'
- name: Build and Test packages
run: |
pnpm -C .npm install
pnpm -C .npm pack:all
- name: Ensure NPM access
run: npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
run: pnpm -C .npm publish -r --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}