name: slim_errors

on:
  pull_request:
    paths-ignore:
      - '.github/ISSUE_TEMPLATE/**'
      - 'web/**'
  push:
    paths-ignore:
      - '.github/ISSUE_TEMPLATE/**'
      - 'web/**'
    branches:
      - master

env:
  RUSTFLAGS: --cfg windows_slim_errors

jobs:
  check:
    strategy:
      matrix:
        include:
          - target: x86_64-pc-windows-msvc
          - target: i686-pc-windows-msvc
          - target: x86_64-pc-windows-gnu
          - target: i686-pc-windows-gnu
        runs-on:
          - windows-2022
    runs-on: ${{ matrix.runs-on }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        
      - name: Update toolchain
        run: rustup update --no-self-update nightly && rustup default nightly-${{ matrix.target }}
        
      - name: Add toolchain target
        run: rustup target add ${{ matrix.target }}

      - name: Fix environment
        uses: ./.github/actions/fix-environment
          
      - name: Test
        run: cargo test -p test_result