-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (69 loc) · 2.76 KB
/
pull-requests.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
name: Test
# This workflow is triggered on pull requests to the main branch.
on:
pull_request:
paths:
- ".github/**"
- "bundle/**"
- "values/**"
- "tasks/**"
- "src/**"
- "chart/**"
- "tasks.yaml"
- "zarf.yaml"
# milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow).
types: [milestoned, opened, reopened, synchronize]
# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
id-token: write # Needed for OIDC-related operations.
contents: read # Allows reading the content of the repository.
pull-requests: read # Allows reading pull request metadata.
# Default settings for all run commands in the workflow jobs.
defaults:
run:
shell: bash -e -o pipefail {0} # Ensures that scripts fail on error and pipefail is set.
jobs:
lint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install UDS CLI
shell: bash
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
run: brew install defenseunicorns/tap/uds@0.9.0
- name: Run Formatting Checks
run: uds run lint-check
deploy:
needs: lint-check
runs-on: "ubuntu-latest"
timeout-minutes: 20
strategy:
matrix:
flavor: [upstream, registry1]
name: Deploy ${{ matrix.flavor }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@417b9c2bc088f664c616c9929a2b3ce448d251f7
- name: Iron Bank Login
if: ${{ matrix.flavor == 'registry1' }}
run: uds zarf tools registry login -u "${{secrets.IRON_BANK_ROBOT_USERNAME}}" -p "${{secrets.IRON_BANK_ROBOT_PASSWORD}}" registry1.dso.mil
- name: Clean Runner
if: ${{ matrix.flavor == 'registry1' }}
uses: defenseunicorns/uds-common/.github/actions/clean-runner@417b9c2bc088f664c616c9929a2b3ce448d251f7
- name: Create test bundle
run: uds run create-test-bundle --set FLAVOR=${{ matrix.flavor }}
- name: Setup cluster
run: uds run setup-cluster
- name: Deploy test bundle
run: uds run deploy-test-bundle
- name: Test package
run: uds run test-package
- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@417b9c2bc088f664c616c9929a2b3ce448d251f7
with:
suffix: '${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}'