Skip to content

Brute Forcer: Fix Path Separators on Windows #138

Brute Forcer: Fix Path Separators on Windows

Brute Forcer: Fix Path Separators on Windows #138

Workflow file for this run

name: Build, Test and Publish
on:
push:
branches: [ main, ci-cd, feature/* ]
tags:
- '*'
pull_request:
branches: [ main, ci-cd ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-13 # macos-latest (macos-12) currently has issues with failing to run some AVX2 instructions.
targetFramework:
- net7.0
- net5.0
- netcoreapp3.1
platform:
- x64
# I'd like to add arm64 here, but GitHub runners don't support it. The native port of Zstandard does support it though.
# Modern Linux and OSX environments also don't support x86 backcompat; and we don't have runners for them either.
include:
- os: windows-latest
targetFramework: net7.0
platform: x86
- os: windows-latest
targetFramework: net5.0
platform: x86
- os: windows-latest
targetFramework: netcoreapp3.1
platform: x86
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: "Setup SDKs & Components"
uses: Nexus-Mods/NexusMods.Archives.Nx/.github/actions/setup-sdks-components@main
- name: Build Tests
run: dotnet build -c Release -f ${{ matrix.targetFramework }} ./NexusMods.Archives.Nx.Tests/NexusMods.Archives.Nx.Tests.csproj
- name: Run Tests
run: dotnet test -c Release -f ${{ matrix.targetFramework }} ./NexusMods.Archives.Nx.Tests/NexusMods.Archives.Nx.Tests.csproj --collect:"XPlat Code Coverage;Format=cobertura;" --results-directory "Coverage" --no-build
- name: "Upload Coverage"
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.os }}-${{ matrix.targetFramework }}
path: Coverage/*/coverage.cobertura.xml
upload:
needs: build
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: "Setup SDKs & Components"
uses: Nexus-Mods/NexusMods.Archives.Nx/.github/actions/setup-sdks-components@main
- name: Build Library
run: dotnet build -c Release ./NexusMods.Archives.Nx/NexusMods.Archives.Nx.csproj
- name: "Install ReportGenerator"
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: "Download Coverage Artifacts"
uses: actions/download-artifact@v3
with:
path: artifacts
- name: "Merge Coverage Files"
run: |
dotnet tool install --global dotnet-coverage
dotnet-coverage merge ./artifacts/*.cobertura.xml --recursive --output ./Cobertura.xml --output-format xml
- name: "Upload Coverage & Packages"
uses: Nexus-Mods/NexusMods.Archives.Nx/.github/actions/upload-coverage-packages@main
with:
code-coverage-path: './Cobertura.xml'
changelog-path: './Changelog.md'
nupkg-glob: '*.nupkg'
snupkg-glob: '*.snupkg'
nuget-key: ${{ secrets.NUGET_KEY }}
changelog-template: 'keepachangelog'
is-release: ${{ startsWith(github.ref, 'refs/tags/') }}
release-tag: ${{ github.ref_name }}