You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
name: _test |
|
run-name: Test ${{ inputs.project-name }} |
|
|
|
on: |
|
workflow_call: |
|
inputs: |
|
project-name: |
|
type: string |
|
required: true |
|
project-path: |
|
type: string |
|
required: true |
|
|
|
jobs: |
|
testing: |
|
name: Test |
|
runs-on: ubuntu-22.04 |
|
permissions: |
|
checks: write |
|
contents: read |
|
pull-requests: write |
|
|
|
steps: |
|
- name: Check out repo |
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
|
with: |
|
fetch-depth: 0 |
|
|
|
- name: Set up .NET |
|
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 |
|
|
|
- name: Cache NuGet packages |
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
|
with: |
|
path: ~/.nuget/packages |
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
|
restore-keys: | |
|
${{ runner.os }}-nuget- |
|
|
|
- name: Install dependencies |
|
run: dotnet restore --locked-mode ${{ inputs.project-path }}/${{ inputs.project-name }}.csproj |
|
|
|
- name: Build |
|
run: dotnet build --verbosity minimal ${{ inputs.project-path }}/${{ inputs.project-name }}.csproj |
|
|
|
- name: Test |
|
run: dotnet test ${{ inputs.project-path }}/${{ inputs.project-name }}.csproj --no-build --logger "trx;LogFileName=mothership-test-results.trx"
|
|
|