forked from defenseunicorns/uds-core
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 3 KB
/
test.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Test packages
on:
# Manual trigger
workflow_dispatch:
inputs:
package:
type: string
description: "The name of the source package to test"
required: true
flavor:
type: string
description: "Flavor of the source package to test"
required: true
test_type:
type: string
description: "The type of test to perform"
required: true
# Triggered by pull-request-conditionals.yaml
workflow_call:
inputs:
package:
type: string
description: "The name of the source package to test"
required: true
flavor:
type: string
description: "Flavor of the source package to test"
required: true
test_type:
type: string
description: "The type of test to perform"
required: true
permissions:
contents: read
id-token: write # This is needed for OIDC federation.
packages: read # Allows reading the published GHCR packages
jobs:
test:
runs-on: "${{ inputs.package == 'all' && 'uds-ubuntu-big-boy-8-core' || 'ubuntu-latest'}}"
timeout-minutes: 30
name: Test
env:
UDS_PKG: ${{ inputs.package }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Environment setup
uses: ./.github/actions/setup
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}
chainguardIdentity: ${{ secrets.CHAINGUARD_IDENTITY }}
- name: Test a single source package
if: ${{ inputs.package != 'all' && inputs.test_type == 'install' }}
run: uds run test-single-package --set FLAVOR=${{ inputs.flavor }} --no-progress
- name: Test UDS Core Install
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test-uds-core --set FLAVOR=${{ inputs.flavor }} --no-progress
- name: Validate UDS Core Compliance
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test-compliance-validate --no-progress
- name: Upload Assessment
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: ${{ inputs.flavor }}-assessment-results
path: ./compliance/oscal-assessment-results.yaml
- name: Test UDS Core Upgrade
if: ${{ inputs.package == 'all' && inputs.test_type == 'upgrade' }}
run: uds run test-uds-core-upgrade --set FLAVOR=${{ inputs.flavor }} --no-progress
- name: Debug Output
if: ${{ always() }}
uses: ./.github/actions/debug-output
- name: Save logs
if: always()
uses: ./.github/actions/save-logs
with:
suffix: -${{ inputs.test_type }}-${{ inputs.package }}-${{ inputs.flavor }}