testcontainers-modules 0.2.0

Community maintained modules for Testcontainers for Rust
Documentation
name: Continuous Integration

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - "**"

env:
  CARGO_TERM_COLOR: always

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

jobs:
  # Build using the specified version of Rust
  msrv:
    name: Build with MSRV
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4
      - name: Get current MSRV from Cargo.toml
        id: current_msrv
        run: |
          msrv=$(cat Cargo.toml | grep rust-version | sed 's/.* = "//; s/"//')
          echo "msrv=$msrv" >> $GITHUB_OUTPUT
      - name: Setup Rust version
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{steps.current_msrv.outputs.msrv}}
      - uses: Swatinem/rust-cache@v2.7.1
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack
      - name: Build
        run: cargo hack build --each-feature --keep-going

  clippy:
    name: Clippy check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          components: clippy
          override: true
      - name: Clippy check
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features

  fmt:
    name: Rustfmt check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          components: rustfmt
          override: true
      - name: Rustfmt check
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check

  prlint:
    name: PR name check
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request'
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: CondeNast/conventional-pull-request-action@v0.2.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          # For PRs we gonna use squash-strategy, so commits names not so matter
          ignoreCommits: "true"

  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        toolchain:
          - stable
          - nightly
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4
      - name: Setup Rust
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.toolchain }}
      - uses: Swatinem/rust-cache@v2.7.1
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack
      - name: Tests
        run: cargo hack test --each-feature