gccjit 4.1.0

Higher-level Rust bindings for libgccjit.
Documentation
# TODO: test more stuff on Windows.

name: CI

on:
  - push
  - pull_request

permissions:
  contents: read

env:
  # Enable backtraces for easier debugging
  RUST_BACKTRACE: 1

jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os:
          - ubuntu-24.04
          - windows-2025

    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: clippy

      - name: Download and install GCC fork
        if: ${{ matrix.os == 'ubuntu-24.04' }}
        run: |
          curl -LO https://github.com/rust-lang/gcc/releases/latest/download/gcc-15.deb
          sudo dpkg --force-overwrite -i gcc-15.deb

      - name: Set env
        run: |
          echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV

      - name: Cache cargo registry
        uses: actions/cache@v3
        with:
          path: ~/.cargo/registry
          key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo index
        uses: actions/cache@v3
        with:
          path: ~/.cargo/git
          key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo target dir
        uses: actions/cache@v3
        with:
          path: target
          key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}

      - name: Build
        if: ${{ matrix.os == 'ubuntu-24.04' }}
        run: |
          cargo build
          cargo build --features master,dlopen
          cargo build --examples

      - name: Build
        if: ${{ matrix.os == 'windows-2025' }}
        run: cargo build --features master,dlopen

      - name: Test
        if: ${{ matrix.os == 'ubuntu-24.04' }}
        run: |
          cd examples/factorial
          cargo build

      - name: clippy
        run: |
          cargo clippy --all-targets -- -D warnings
          cargo clippy --all-targets --features master,dlopen -- -D warnings

          cd gccjit_sys
          cargo clippy --all-targets -- -D warnings
          cargo clippy --all-targets --features master,dlopen -- -D warnings