name: CI on: push: branches: [main, master] pull_request: branches: [main, master] workflow_dispatch: defaults: run: shell: bash --noprofile --norc -eo pipefail {0} concurrency: group: ci-${{ github.event_name }}-${{ github.ref_name }} cancel-in-progress: true jobs: build: name: ${{ matrix.name }} runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: include: - { name: Linux (x86_64), runner: ubuntu-latest, os: linux } - { name: Linux (ARM64), runner: ubuntu-24.04-arm, os: linux } - { name: macOS, runner: macos-latest, os: macos } steps: - uses: actions/checkout@v4 - name: Install LLVM 22 (Linux) if: matrix.os == 'linux' run: | wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \ | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null codename=$(lsb_release -cs) echo "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-22 main" \ | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-get update sudo apt-get install -y llvm-22-dev libclang-22-dev clang-22 cmake echo "LLVM_CONFIG=/usr/lib/llvm-22/bin/llvm-config" >> "$GITHUB_ENV" echo "/usr/lib/llvm-22/bin" >> "$GITHUB_PATH" /usr/lib/llvm-22/bin/llvm-config --version - name: Install LLVM 22 (macOS) if: matrix.os == 'macos' run: | brew install llvm@22 LLVM_PREFIX="$(brew --prefix llvm@22)" echo "${LLVM_PREFIX}/bin" >> "$GITHUB_PATH" echo "LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config" >> "$GITHUB_ENV" echo "LLVM_PREFIX=${LLVM_PREFIX}" >> "$GITHUB_ENV" "${LLVM_PREFIX}/bin/llvm-config" --version - name: Install Rust run: | rustup toolchain install 1.96 --profile minimal --component rustfmt,clippy rustup show - name: Cargo cache uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: cargo-${{ matrix.name }}-${{ hashFiles('Cargo.lock') }} - name: Build (release) run: cargo build --release -p jam - name: Format check run: cargo fmt --all --check - name: Clippy run: cargo clippy --workspace --all-targets - name: Unit tests run: cargo test --workspace # - name: Archive jam binary # uses: actions/upload-artifact@v4 # with: # name: jam-${{ matrix.name }} # path: target/release/jam