contracts 0.6.11

Design-by-contract attributes
Documentation
name: CI

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
  merge_group:
  push:
    branches: [main]

permissions:
  contents: read

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

jobs:
  read_msrv:
    name: Read MSRV
    uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@2e4effc4a4a9437253f7f659990d4ac5ec9c7854 # main

  test:
    needs: read_msrv

    strategy:
      fail-fast: false
      matrix:
        toolchain:
          - { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" }
          - { name: stable, version: stable }

    runs-on: ubuntu-latest

    name: Test / ${{ matrix.toolchain.name }}

    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false

      - name: Install Nix
        uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35

      - name: Install Rust (${{ matrix.toolchain.name }})
        uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
        with:
          toolchain: ${{ matrix.toolchain.version }}

      - name: Install cargo-nextest
        uses: taiki-e/install-action@9983c65e42da123ff25d1f78505eb6de315aa172 # v2.87.20
        with:
          tool: cargo-nextest

      - name: Enter Nix devshell
        uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
        with:
          arguments: .#ci

      - name: Downgrade for MSRV
        if: matrix.toolchain.name == 'msrv'
        run: just downgrade-for-msrv

      - name: Test
        run: just test-no-coverage