Skip to content

Grant CPU resources to component using fuel API #431

Grant CPU resources to component using fuel API

Grant CPU resources to component using fuel API #431

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
paths-ignore:
- '*.md'
- 'docs/**'
- 'LICENSE'
- 'MAINTAINERS'
- 'NOTICE'
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- 'docs/**'
- 'LICENSE'
- 'MAINTAINERS'
- 'NOTICE'
env:
CARGO_TERM_COLOR: always
jobs:
license-headers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Verify Rust license headers
shell: bash
run: |
set -euo pipefail
bash ./scripts/copyright.sh
# If the script made any changes to Rust files, fail and list them
if git diff --name-only -- '*.rs' | grep -q .; then
echo "The following Rust files are missing license headers:" >&2
git diff --name-only -- '*.rs' >&2
echo >&2
echo "Please run ./scripts/copyright.sh locally and commit the changes." >&2
exit 1
fi
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: ./scripts/install-protobuf.sh
shell: bash
- uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 # v1.14.0
with:
components: rustfmt, clippy
- run:
# needed to run rustfmt in nightly toolchain
rustup toolchain install nightly --component rustfmt
- uses: ./.github/actions/rust-cache
- name: Run fmt
run: cargo +nightly fmt --all -- --check
- name: Run Clippy
run: cargo clippy --verbose --workspace
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0
- run: ./scripts/install-protobuf.sh
shell: bash
- uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 # v1.14.0
- run: rustup target add wasm32-wasip2
- uses: ./.github/actions/rust-cache
- name: Build
run: just build
- name: Run tests
run: just test
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wassette
path: bin/wassette
deps:
name: unused dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 # v1.14.0
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- name: Check unused dependencies
uses: bnjbvr/cargo-machete@7959c845782fed02ee69303126d4a12d64f1db18 # v0.9.1
security:
name: security audit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 # v1.14.0
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- name: Install cargo-audit
run: cargo install cargo-audit
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Run cargo audit
run: |
# Run cargo audit - fail only on actual vulnerabilities, not warnings
cargo audit
- name: Run cargo deny check
run: cargo deny check advisories licenses bans sources
spelling:
name: spell check with typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Spell Check Repo
uses: crate-ci/typos@a4c3e43aea0a9e9b9e6578d2731ebd9a27e8f6cd # v1.35.5
linkChecker:
name: link checker
permissions:
contents: read
if: github.repository == 'microsoft/wassette'
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: lycheeverse/lychee-action@01a5c94d8e012550040658854b90a7a7301e75ca # v2.6.0
with:
fail: false # don't fail the build on broken links
format: markdown
jobSummary: true