Skip to content

solve second puzzle correctly #510

solve second puzzle correctly

solve second puzzle correctly #510

Workflow file for this run

name: Build NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
year: [2024, 2023, 2022, 2021, 2020]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Restore packages for Advent of Code ${{ matrix.year }}
run: dotnet restore ${{ matrix.year }}/AdventOfCode${{ matrix.year }}.sln
- name: Install Coverlet
run: dotnet tool install --global coverlet.console
- name: Build Advent of Code ${{ matrix.year }} solution
run: dotnet build --configuration Debug --no-restore ${{ matrix.year }}/AdventOfCode${{ matrix.year }}.sln /p:DefineConstants="CI_CONTEXT"
- name: Testing Advent of Code ${{ matrix.year }} project
working-directory: ${{ matrix.year }}
run: |
for d in `seq 25`; do
if [ -d Day$d ]; then
coverlet Day$d/Day$d.UnitTests/bin/Debug/net7.0/Day$d.UnitTests.dll --target "dotnet" --targetargs "test Day$d/Day$d.UnitTests/Day$d.UnitTests.csproj --no-build" --format OpenCover --output ../adventofcode-${{ matrix.year }}-day$d.coverage.xml
fi
done
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.year }}
path: ./*.coverage.xml