hexpm 5.1.1

A Rust client for the Hex package manager
Documentation
name: ci

on:
  pull_request:
  push:
    branches:
      - main
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  test:
    name: test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        toolchain: [stable]
        build: [linux-amd64, macos, windows]
        include:
          - build: linux-amd64
            os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - build: macos
            os: macos-latest
            target: x86_64-apple-darwin
          - build: windows
            os: windows-latest
            target: x86_64-pc-windows-msvc
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ matrix.toolchain }}
          target: ${{ matrix.target }}

      - name: Run tests
        uses: clechasseur/rs-cargo@v2
        with:
          command: test
          args: --workspace --target ${{ matrix.target }}

  format-lint:
    name: format-lint
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: stable
          components: clippy, rustfmt

      - name: Check formatting
        run: cargo fmt --all -- --check

      - name: Run linter
        run: cargo clippy --workspace