solve second puzzle correctly #510
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |