perf: set weight metadata on switches too #135
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: [main] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
LLVM_VERSION: "17" # Must be just the major version | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: test +${{ matrix.runner }}-${{ matrix.arch }}-${{ matrix.toolchain }} ${{ matrix.profile }} | |
runs-on: ${{ matrix.runner }} | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: ["ubuntu-latest", "macos-14"] | |
arch: ["x64", "arm64"] | |
toolchain: ["stable", "nightly"] | |
profile: ["dev", "release"] | |
exclude: | |
- runner: "ubuntu-latest" | |
arch: "arm64" | |
- runner: "macos-14" | |
arch: "x64" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install LLVM (apt) | |
if: ${{ !contains(matrix.runner, 'macos') }} | |
run: | | |
v=${{ env.LLVM_VERSION }} | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh $v all | |
bins=(clang llvm-config lld ld.lld FileCheck) | |
for bin in "${bins[@]}"; do | |
sudo ln -fs $(which $bin-$v) /usr/bin/$bin | |
done | |
- name: Install LLVM (brew) | |
if: ${{ contains(matrix.runner, 'macos') }} | |
run: | | |
v=${{ env.LLVM_VERSION }} | |
brew install "llvm@${v}" | |
echo "LLVM_SYS_${v}0_PREFIX=$(brew --prefix llvm@${v})" >> $GITHUB_ENV | |
echo "/opt/homebrew/opt/llvm@${v}/bin" >> $GITHUB_PATH | |
- name: llvm-config | |
run: llvm-config --version --bindir --libdir | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: test | |
run: cargo test --all-features --workspace --profile ${{ matrix.profile }} | |
feature-checks: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: KyleMayes/[email protected] | |
with: | |
version: ${{ env.LLVM_VERSION }} | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: cargo hack | |
# The builtins library cannot be built with `no_std`. | |
run: cargo hack check --feature-powerset --depth 2 --workspace --exclude revm-jit-builtins | |
clippy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: KyleMayes/[email protected] | |
with: | |
version: ${{ env.LLVM_VERSION }} | |
- uses: dtolnay/rust-toolchain@clippy | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- run: cargo clippy --workspace --all-targets --all-features | |
env: | |
RUSTFLAGS: -Dwarnings | |
docs: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: KyleMayes/[email protected] | |
with: | |
version: ${{ env.LLVM_VERSION }} | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- run: cargo doc --workspace --all-features --no-deps --document-private-items | |
env: | |
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options | |
# - name: Deploy documentation | |
# uses: peaceiris/actions-gh-pages@v3 | |
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: target/doc | |
# force_orphan: true | |
fmt: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt --all --check |