Repository navigation
52 lines (43 loc) · 1.68 KB
/
Copy pathreusable-build-test.yml
File metadata and controls
52 lines (43 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# ---------------------------------------------------------------------------
# Reusable CI for a single service: restore, build (Release), run the test
# project, and list vulnerable packages. Invoked by every per-service workflow
# via `workflow_call`. Building the test project transitively builds the API,
# so only the test project path is needed.
# ---------------------------------------------------------------------------
name: reusable-build-test
on:
workflow_call:
inputs:
serviceName:
description: 'Short service name, used for log/step labels.'
required: true
type: string
testProjectPath:
description: 'Relative path to the service test csproj.'
required: true
type: string
permissions:
contents: read
jobs:
build-test:
name: Build · Test (${{ inputs.serviceName }})
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Install .NET SDK (from global.json)
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore
run: dotnet restore "${{ inputs.testProjectPath }}"
- name: Build (Release)
run: dotnet build "${{ inputs.testProjectPath }}" --configuration Release --no-restore
- name: Test (Release)
run: dotnet test "${{ inputs.testProjectPath }}" --configuration Release --no-build
- name: Vulnerable package scan (informational)
run: dotnet list "${{ inputs.testProjectPath }}" package --vulnerable --include-transitive || true