microfetch 0.4.13

Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed
Documentation
name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test on ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - os: ubuntu-latest
            target: aarch64-unknown-linux-gnu

    steps:
    - name: "Checkout"
      uses: actions/checkout@v6

    - name: "Setup Rust toolchain"
      uses: actions-rust-lang/setup-rust-toolchain@v1
      with:
        target: ${{ matrix.target }}

    - name: "Install cross-compilation tools"
      if: matrix.target == 'aarch64-unknown-linux-gnu'
      run: |
        sudo apt-get update
        sudo apt-get install -y gcc-aarch64-linux-gnu

    - name: "Configure linker for aarch64"
      if: matrix.target == 'aarch64-unknown-linux-gnu'
      run: |
        mkdir -p .cargo
        cat >> .cargo/config.toml << EOF
        [target.aarch64-unknown-linux-gnu]
        linker = "aarch64-linux-gnu-gcc"
        EOF

    - name: "Build"
      run: cargo build --verbose --target ${{ matrix.target }}

    - name: "Run tests"
      if: matrix.target == 'x86_64-unknown-linux-gnu'
      run: cargo test --verbose --target ${{ matrix.target }}