Skip to content

Merge pull request #203 from VATSIM-UK/dependabot/nuget/Newtonsoft.Js… #385

Merge pull request #203 from VATSIM-UK/dependabot/nuget/Newtonsoft.Js…

Merge pull request #203 from VATSIM-UK/dependabot/nuget/Newtonsoft.Js… #385

name: Build Test and Coverage
on:
push:
branches:
- 'main'
pull_request:
jobs:
Build_Test_Coverage:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Restore Nuget Packages
run: dotnet restore SectorFileCompiler.sln --packages packages
- name: Run Build
run: dotnet build /p:Configuration=Release SectorFileCompiler.sln --nologo --no-restore /warnaserror;
- name: Run Compiler Tests With Coverage
if: matrix.platform == 'ubuntu-latest'
run: |
cd tests/CompilerTest
dotnet dotcover test --dcReportType=DetailedXml --dcOutput=../../coverage/Compiler.xml
- name: Run Compiler Tests
if: matrix.platform != 'ubuntu-latest'
run: |
cd tests/CompilerTest
dotnet test
- name: Run Compiler CLI Tests With Coverage
if: matrix.platform == 'ubuntu-latest'
run: |
cd tests/CompilerCliTest
dotnet dotcover test --dcReportType=DetailedXml --dcOutput=../../coverage/CompilerCli.xml
- name: Run Compiler CLI Tests
if: matrix.platform != 'ubuntu-latest'
run: |
cd tests/CompilerCliTest
dotnet test
- name: Publish Assets
if: matrix.platform == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .\.github\workflows\publish.ps1
shell: powershell
- name: Upload Windows Assets
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: "cli-windows-x64"
path: "publish/windows/CompilerCli.exe"
- name: Upload Linux Assets
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: "cli-linux-x64"
path: "publish/linux/CompilerCli"
- name: Upload OSX Assets
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: "cli-osx-x64"
path: "publish/osx/CompilerCli"
- name: Upload Code Coverage Reports
if: matrix.platform == 'ubuntu-latest'
run: |
cd coverage
bash <(curl -s https://codecov.io/bash) -f *.xml
# If we're building on main, lets do a release
- name: Create Release
if: github.ref == 'refs/heads/main' && matrix.platform == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release@17