sqlite-containers 1.0.0

SQLite-based containers for Rust
Documentation
name: CI/CD

permissions:
  contents: read

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  release:
    types: [created]

jobs:
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # Code checks
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  clippy:
    name: Checks
    strategy:
      matrix:
        rust: ["1.88.0", "1.99.0"]
        platform:
          - host: ubuntu-26.04
            target: x86_64-unknown-linux-gnu
            multilib: false
            add_make: false
          - host: ubuntu-26.04
            target: i686-unknown-linux-gnu
            multilib: true
            add_make: false
          - host: ubuntu-26.04-arm
            target: aarch64-unknown-linux-gnu
            multilib: false
            add_make: false
          - host: windows-latest
            target: x86_64-pc-windows-msvc
            multilib: false
            add_make: true
          - host: windows-latest
            target: i686-pc-windows-msvc
            multilib: false
            add_make: true
          - host: windows-11-arm
            target: aarch64-pc-windows-msvc
            multilib: false
            add_make: true
          - host: macos-26
            target: aarch64-apple-darwin
            multilib: false
            add_make: false
          - host: macos-26-intel
            target: x86_64-apple-darwin
            multilib: false
            add_make: false

    runs-on: ${{ matrix.platform.host }}
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v2
        with:
          toolchain: ${{ matrix.rust }}
          target: ${{ matrix.platform.target }}
          components: rustfmt clippy
          cache: false
      - if: ${{ matrix.platform.multilib }}
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-multilib libc6-dev-i386
      - if: ${{ matrix.platform.add_make }}
        run: |
          choco install make --yes --no-progress --stoponfirstfailure --failonunfound
          Remove-Item "C:\mingw64\bin\make.exe" -Force
      - run: make clippy
        env:
          CARGO_BUILD_TARGET: ${{ matrix.platform.target }}
          CARGO_PROFILE_RELEASE_DEBUG: true
          RUST_BACKTRACE: 1

  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # Regression tests
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  tests:
    name: Tests
    needs: clippy
    strategy:
      matrix:
        rust: ["1.88.0", "1.99.0"]
        platform:
          - host: ubuntu-26.04
            target: x86_64-unknown-linux-gnu
            multilib: false
            add_make: false
          - host: ubuntu-26.04
            target: i686-unknown-linux-gnu
            multilib: true
            add_make: false
          - host: ubuntu-26.04-arm
            target: aarch64-unknown-linux-gnu
            multilib: false
            add_make: false
          - host: windows-latest
            target: x86_64-pc-windows-msvc
            multilib: false
            add_make: true
          - host: windows-latest
            target: i686-pc-windows-msvc
            multilib: false
            add_make: true
          - host: windows-11-arm
            target: aarch64-pc-windows-msvc
            multilib: false
            add_make: true
          - host: macos-26
            target: aarch64-apple-darwin
            multilib: false
            add_make: false
          - host: macos-26-intel
            target: x86_64-apple-darwin
            multilib: false
            add_make: false

    runs-on: ${{ matrix.platform.host }}
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v2
        with:
          toolchain: ${{ matrix.rust }}
          target: ${{ matrix.platform.target }}
          cache: false
      - if: ${{ matrix.platform.multilib }}
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-multilib libc6-dev-i386
      - if: ${{ matrix.platform.add_make }}
        run: |
          choco install make --yes --no-progress --stoponfirstfailure --failonunfound
          Remove-Item "C:\mingw64\bin\make.exe" -Force
      - run: make test
        env:
          CARGO_BUILD_TARGET: ${{ matrix.platform.target }}
          CARGO_PROFILE_RELEASE_DEBUG: true
          RUST_BACKTRACE: 1

  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # Code coverage
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  codecov:
    name: Codecov
    needs: clippy

    runs-on: ubuntu-26.04
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v2
        with:
          toolchain: 1.99.0
          target: x86_64-unknown-linux-gnu
          components: llvm-tools-preview
          cache: false
      - uses: taiki-e/install-action@cargo-llvm-cov
      - run: make codecov
        env:
          CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
          CARGO_PROFILE_RELEASE_DEBUG: true
          RUST_BACKTRACE: 1
      - uses: codecov/codecov-action@v7
        with:
          files: target/codecov-output.info
          verbose: true
          token: ${{ secrets.CODECOV_TOKEN }}

  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # Publish to crates.io
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  publish:
    name: Publish
    needs: [tests, codecov]
    if: ${{ github.event_name == 'release' }}

    runs-on: ubuntu-26.04
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v2
        with:
          toolchain: 1.99.0
          target: x86_64-unknown-linux-gnu
          cache: false
      - run: make publish
        env:
          CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}