-
Notifications
You must be signed in to change notification settings - Fork 45
86 lines (75 loc) · 3.01 KB
/
Copy pathtest.yaml
File metadata and controls
86 lines (75 loc) · 3.01 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
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
# Copyright 2024-2026 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
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 core package layer 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:
# Use the 8 core runner for full-core or 4 core runner (with larger disk) for func layers tests
runs-on: "${{ inputs.package == 'all' && 'uds-ubuntu-big-boy-8-core' || 'uds-ubuntu-big-boy-4-core'}}"
# Increase the timeout for longer upgrades
timeout-minutes: ${{ inputs.test_type == 'upgrade' && 60 || 30 }}
name: Test
env:
UDS_LAYER: ${{ inputs.package }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Environment setup
uses: ./.github/actions/setup
with:
ghToken: ${{ secrets.GITHUB_TOKEN }}
registry1Username: ${{ (inputs.flavor == 'registry1') && secrets.IRON_BANK_ROBOT_USERNAME || '' }}
registry1Password: ${{ (inputs.flavor == 'registry1') && secrets.IRON_BANK_ROBOT_PASSWORD || '' }}
chainguardIdentity: ${{ (inputs.flavor == 'unicorn') && secrets.CHAINGUARD_IDENTITY || '' }}
installK3d: 'true'
- name: Test a single layer package
if: ${{ inputs.package != 'all' && inputs.test_type == 'install' }}
run: uds run test-single-layer --set FLAVOR=${{ inputs.flavor }} --set LAYER=${{ inputs.package }} --no-progress
- name: Test UDS Core Install
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test:uds-core-e2e --set FLAVOR=${{ inputs.flavor }} --no-progress
- 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 }}