teamsiso/.forgejo/workflows/ci.yml
Zac Gaetano dae8f35db9 ci(forgejo): pin actions/upload-artifact to v3
Forgejo Actions runs in GHES compat mode and the bundled @actions/artifact toolkit only supports the v3 protocol. v4 fails with:

    GHESNotSupportedError: @actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.

Build, tests (72/72), and the 80% coverage gate (currently 86.7%) all pass; only the trailing artifact-upload steps were red, which fails the whole run. Pinning to v3 restores green.
2026-05-08 00:36:58 -04:00

72 lines
2.3 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8
run: |
curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 8.0 --install-dir $HOME/.dotnet
echo "$HOME/.dotnet" >> $GITHUB_PATH
echo "DOTNET_ROOT=$HOME/.dotnet" >> $GITHUB_ENV
- name: Restore (Linux solution filter — excludes Windows-only WPF app)
run: dotnet restore TeamsISO.Linux.slnf
- name: Build (Release, treat warnings as errors)
run: dotnet build TeamsISO.Linux.slnf --configuration Release --no-restore
- name: Test (excluding requires=ndi)
run: >
dotnet test TeamsISO.Linux.slnf
--configuration Release
--no-build
--logger "trx;LogFileName=test-results.trx"
--collect:"XPlat Code Coverage"
--settings coverlet.runsettings
--filter "Category!=ndi&requires!=ndi"
- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Generate coverage report
run: |
export PATH="$PATH:$HOME/.dotnet/tools"
reportgenerator \
-reports:"**/coverage.cobertura.xml" \
-targetdir:coverage-report \
-reporttypes:"Cobertura;TextSummary" \
-assemblyfilters:"+TeamsISO.Engine;-TeamsISO.Engine.NdiInterop"
- name: Enforce coverage threshold (80%)
run: |
summary=$(cat coverage-report/Summary.txt)
echo "$summary"
line_coverage=$(echo "$summary" | awk '/Line coverage/ {print $3}' | tr -d '%')
echo "Line coverage: $line_coverage%"
awk -v c="$line_coverage" 'BEGIN { if (c+0 < 80) { exit 1 } }'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: '**/test-results.trx'
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage-report/