Update dependencies and optimize benchmark configuration (#36) #78
This file contains hidden or 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: ci | |
| on: | |
| push: | |
| pull_request: | |
| branches: [ 'main' ] | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNET_NOLOGO: 1 | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_GENERATE_ASPNET_CERTIFICATE: 0 | |
| RestoreLockedMode: true | |
| RepositoryBranch: '${{ github.ref_name }}' | |
| RepositoryCommit: '${{ github.sha }}' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| Configuration: ['Debug', 'Release'] | |
| env: | |
| Configuration: '${{ matrix.configuration }}' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8 | |
| 10 | |
| - name: restore | |
| run: dotnet restore | |
| - name: build | |
| run: dotnet build --no-restore | |
| - name: test | |
| run: dotnet test --no-restore --no-build | |
| - name: pack | |
| if: ${{ matrix.configuration == 'Release' }} | |
| run: | | |
| dotnet pack src/VbaCompiler/VbaCompiler.csproj --no-build --no-restore -o dist | |
| dotnet pack src/vbamc/vbamc.csproj --no-build --no-restore -o dist | |
| - name: publish artifact | |
| if: ${{ matrix.configuration == 'Release' }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: 'vbamc_packages_${{ matrix.configuration }}' | |
| path: '${{ github.workspace }}/dist' | |
| benchmark: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ['ubuntu-24.04', 'windows-2025'] | |
| env: | |
| Configuration: 'Release' | |
| PROJECT: 'tests/VbaCompiler.Benchmark/VbaCompiler.Benchmark.csproj' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8 | |
| 10 | |
| - name: restore | |
| run: dotnet restore | |
| - name: build | |
| run: dotnet build --no-restore -c Release tests/VbaCompiler.Benchmark/VbaCompiler.Benchmark.csproj | |
| - name: benchmark | |
| shell: bash | |
| run: | | |
| dotnet run -c Release -f net10.0 --launch-profile benchmark --project tests/VbaCompiler.Benchmark/VbaCompiler.Benchmark.csproj | |
| { | |
| echo "## VBA Compiler Benchmark" | |
| echo "" | |
| echo "Runner: \`${{ matrix.os }}\`" | |
| echo "" | |
| cat BenchmarkDotNet.Artifacts/results/*-report-github.md | |
| } >> $GITHUB_STEP_SUMMARY |