Skip to content

chore: Update Rust to v1.98 (#28) #95

chore: Update Rust to v1.98 (#28)

chore: Update Rust to v1.98 (#28) #95

Workflow file for this run

name: CI Jobs
on:
push:
branches: main
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# Fail every cargo invocation on warnings from workspace-local packages
# (cargo's build.warnings, stable since 1.97). CI-only: local builds
# still just warn.
env:
CARGO_BUILD_WARNINGS: deny
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# Warnings are handled by CARGO_BUILD_WARNINGS above, which applies
# to local packages only. The action defaults to `-D warnings`,
# which also denies warnings from dependencies.
rustflags: ""
# Simpler to install Lean than to use lean-action for only this purpose.
- name: Install Lean
run: |
curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | sh -s -- -y --default-toolchain $(cat lean-toolchain)
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Check Rustfmt code style
uses: actions-rust-lang/rustfmt@v1
- name: Check clippy warnings
run: cargo clippy --workspace --all-targets --all-features
- name: Check *everything* compiles
run: cargo check --workspace --all-targets --all-features
- name: Run workspace tests
run: cargo test --workspace --all-targets --all-features
# Restore and then save .lake to the GitHub cache
# Essentially the same as lean-action but without re-downloading the Lean toolchain
- uses: actions/cache@v6
with:
path: ./.lake
key: lake-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}-${{ github.sha }}
restore-keys: lake-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}
- run: lake build --wfail -v
- run: lake test
- name: Install valgrind
run: sudo apt-get update && sudo apt-get install -y valgrind
- name: Run tests under valgrind
run: |
valgrind \
--leak-check=full \
--show-leak-kinds=definite,possible \
--errors-for-leak-kinds=definite \
--track-origins=yes \
--error-exitcode=1 \
.lake/build/bin/LeanFFITests
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v17
with:
name: argumentcomputer
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: nix build --print-build-logs --accept-flake-config
# One step per check for separate logs; the store is shared across
# steps, so nothing rebuilds.
- run: nix build --print-build-logs --accept-flake-config .#checks.x86_64-linux.clippy
- run: nix build --print-build-logs --accept-flake-config .#checks.x86_64-linux.lean-ffi-test
# Catch-all: near-free after the steps above; fails if a check is added
# to the flake without a step here.
- run: nix flake check --accept-flake-config