Files
LuaCsForBarotraumaEP/.github/workflows/run-tests.yml
peelz 3de2d8e550 Change on-push workflow to run unit tests
This changes workflows to run unit tests for every new commit (including
PRs). A new release will only be published if all tests pass on the
master branch.
2022-08-10 05:55:43 -04:00

51 lines
1.2 KiB
YAML

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Run tests
on:
workflow_call:
inputs:
ref:
required: true
type: string
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
- name: Initialize environment
run: |
mkdir -p ~/".local/share/Daedalic Entertainment GmbH/Barotrauma"
- name: Run tests
continue-on-error: true
run: dotnet test LinuxSolution.sln -clp:"ErrorsOnly;Summary" --logger "trx;LogFileName=$PWD/test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test-results.trx
- name: Report test results
uses: dorny/test-reporter@v1
with:
name: Test results
path: test-results.trx
fail-on-error: true
reporter: dotnet-trx