Merge pull request #158 from Eddieddg1/master #807
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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
formatting: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check formatting | |
run: dotnet format --verify-no-changes --severity error | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | |
env: | |
OS: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print Debug Info | |
run: dotnet --info | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Run Tests | |
run: dotnet test --no-build --no-restore --logger "GitHubActions" --collect:"XPlat Code Coverage;Format=opencover" | |
# - name: Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# files: coverage.xml | |
# fail_ci_if_error: false | |
# env_vars: OS | |
# flags: ${{ env.OS }} | |
- name: Publish (Linux) | |
if: runner.os == 'Linux' | |
run: dotnet publish other/GameFinder.Example/GameFinder.Example.csproj -o ${{ github.workspace }}/bin/${{ runner.os }} -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=false | |
- name: Publish (Windows) | |
if: runner.os == 'Windows' | |
run: dotnet publish other/GameFinder.Example/GameFinder.Example.csproj -o ${{ github.workspace }}/bin/${{ runner.os }} -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=false | |
- name: Publish (macOS) | |
if: runner.os == 'macOS' | |
run: dotnet publish other/GameFinder.Example/GameFinder.Example.csproj -o ${{ github.workspace }}/bin/${{ runner.os }} -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=false | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: GameFinder.Example-${{ env.OS }}-${{ github.sha }} | |
path: ${{ github.workspace }}/bin/${{ runner.os }}/GameFinder* | |
if-no-files-found: error |