on:
  pull_request:
  push:
    branches-ignore:
      - 'dev'
jobs:
  test-build:
    runs-on: docker
    container:
      image: iceshrimp.dev/iceshrimp/ci-env:dotnet9
      options: --volume /opt/iceshrimp-cache/nuget:/root/.nuget
    steps:
      - name: Clone repository
        run: |
          git init -b test-build
          git remote add origin "$REPO"
          git fetch origin "$REF" --depth=1
          git checkout --detach FETCH_HEAD
        env:
          REPO: ${{ github.event.repository.clone_url }}
          REF: ${{ github.ref }}
      - name: Print environment info
        run: dotnet --info
      - name: Run unit tests
        run: make test VERBOSE=true DEP_VULN_WERROR=true
