sqlite-containers 2.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:
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # Test & Build
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  build:
    name: Test & Build
    strategy:
      matrix:
        rust: ["1.88.0", "1.99.0"]
        platform:
          - host: ubuntu-26.04
            target: x86_64-unknown-linux-gnu
          - host: ubuntu-26.04
            target: i686-unknown-linux-gnu
          - host: ubuntu-26.04-arm
            target: aarch64-unknown-linux-gnu
          - host: windows-latest
            target: x86_64-pc-windows-msvc
          - host: windows-latest
            target: i686-pc-windows-msvc
          - host: windows-11-arm
            target: aarch64-pc-windows-msvc
          - host: macos-26
            target: aarch64-apple-darwin
          - host: macos-26-intel
            target: x86_64-apple-darwin

    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.target == 'i686-unknown-linux-gnu' }}
        run: |
          sudo apt-get update -qq
          sudo apt-get install -y --no-install-recommends gcc-multilib libc6-dev-i386
        env:
          DEBIAN_FRONTEND: noninteractive
      - if: ${{ startsWith(matrix.platform.host, 'windows') }}
        run: |
          choco install make --yes --no-progress --stoponfirstfailure --failonunfound
          Add-Content -Path ${env:GITHUB_PATH} -Value "${env:ProgramData}\chocolatey\lib\make\tools\install\bin"
      - run: make
        env:
          CARGO_BUILD_TARGET: ${{ matrix.platform.target }}
          CARGO_PROFILE_RELEASE_DEBUG: true
          RUST_BACKTRACE: 1

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

    runs-on: ubuntu-26.04
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v2
        with:
          toolchain: 1.99.0
          components: llvm-tools-preview
          cache: false
      - uses: taiki-e/install-action@cargo-llvm-cov
      - run: make codecov
        env:
          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: 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
          cache: false
      - run: make publish
        env:
          CARGO_PROFILE_RELEASE_DEBUG: true
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          RUST_BACKTRACE: 1