Replace derivative by educe #4127
Workflow file for this run
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
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.79.0 | |
RUST_VERSION_FMT: nightly-2024-02-07 | |
RUST_VERSION_COV: nightly-2024-06-05 | |
GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
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 alloc --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 }} | |
publish-codecov: | |
name: Publish code coverage report on GitHub pages branch | |
runs-on: buildjet-4vcpu-ubuntu-2204 | |
needs: | |
- cargo | |
permissions: # Write access to push changes to pages | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install latest Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION_COV }} | |
- name: Install cargo-llvm-codecov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Code coverage report | |
run: cargo +${{ env.RUST_VERSION_COV }} llvm-cov --all-features --html --branch | |
- name: Checkout the repo again for pushing pages revision | |
uses: actions/checkout@v3 | |
with: | |
ref: 'codecov-pages' | |
path: 'pages-branch' | |
- name: Push codecov report to pages branch | |
working-directory: ./pages-branch | |
run: | | |
export BRANCH_B64=$(echo -n "${{ env.GIT_BRANCH }}" | basenc --base64url) | |
git config user.email "2204863+Dentosal@users.noreply.github.com" | |
git config user.name "Dentosal" | |
cp -r ../target/llvm-cov/html "$BRANCH_B64" | |
python3 ../.github/workflows/scripts/generate_pages_index.py > index.html | |
git add . | |
git commit -m "Update codecov for ${{ env.GIT_BRANCH }}" | |
git push | |
export PAGES_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/$BRANCH_B64/index.html" | |
echo "$PAGES_URL" | |
echo "Codecov report $PAGES_URL" >> $GITHUB_STEP_SUMMARY | |
rustfmt: | |
runs-on: buildjet-4vcpu-ubuntu-2204 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install latest nightly | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION_FMT }} | |
components: rustfmt | |
- name: Rustfmt check | |
run: cargo +${{ env.RUST_VERSION_FMT }} 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 | |
- publish-check | |
- publish-wasm-packages-check | |
runs-on: ubuntu-latest | |
steps: | |
- run: true | |
publish-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
- name: Publish crate check | |
uses: FuelLabs/publish-crates@v1 | |
with: | |
dry-run: true | |
check-repo: false | |
ignore-unpublished-changes: true | |
publish-wasm-packages-check: | |
needs: | |
- publish-check | |
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@v4 | |
with: | |
version: ^9.4.0 | |
- 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 | |
publish: | |
# Only do this job if publishing a release and all checks pass. | |
needs: | |
- verifications-complete | |
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: FuelLabs/publish-crates@v1 | |
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@v4 | |
with: | |
version: ^9.4.0 | |
- 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 }} |