Skip to content

Commit

Permalink
add separate work flow and dry up package setup
Browse files Browse the repository at this point in the history
  • Loading branch information
decleaver committed Nov 4, 2024
1 parent 6c9b4cc commit 149a9fb
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 72 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/flavor-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# This workflow runs smoke tests for the unicorn and registry1 flavors of UDS Runtime.
name: Flavor Tests
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * 1" # Runs Mondays at 9:00 AM UTC, which is 3:00 AM MT during Daylight Saving Time

permissions:
contents: read

jobs:
smoke-test-flavors:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [registry1, unicorn]
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: Iron Bank Login
env:
REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}

Check failure on line 29 in .github/workflows/flavor-tests.yaml

View workflow job for this annotation

GitHub Actions / validate

29:13 [indentation] wrong indentation: expected 10 but found 12
REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
shell: bash

- name: smoke-test
run: |
uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }}
25 changes: 1 addition & 24 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,9 @@ jobs:
run: |
uds run test:smoke
smoke-test-flavors:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [registry1, unicorn]
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: Iron Bank Login
env:
REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
shell: bash

- name: smoke-test
run: |
uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }}
push:
runs-on: ubuntu-latest
needs: [test, smoke-test, smoke-test-flavors]
needs: [test, smoke-test]
permissions:
contents: write
packages: write
Expand Down
45 changes: 6 additions & 39 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,10 @@ permissions:
contents: read

jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: smoke-test
run: |
uds run test:smoke
smoke-test-flavors:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [registry1, unicorn]
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: Iron Bank Login
env:
REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
shell: bash

- name: smoke-test
run: |
uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }}

tag-new-version:
permissions: write-all
runs-on: ubuntu-latest
needs: [smoke-test, smoke-test-flavors]
outputs:
release_created: ${{ steps.release-flag.outputs.release_created }}
release_tag: ${{ steps.release-tag.outputs.release_tag }}
Expand Down Expand Up @@ -86,11 +50,14 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: smoke-test
run: uds run test:smoke

- name: Iron Bank Login
env:
REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
REGISTRY1_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
REGISTRY1_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
run: echo "${{ env.REGISTRY1_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY1_USERNAME }}" --password-stdin registry1.dso.mil
shell: bash

- name: Publish
Expand Down
25 changes: 25 additions & 0 deletions hack/flavors/common/zarf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
kind: ZarfPackageConfig
metadata:
name: uds-common-runtime
description: "UDS Common Runtime"
components:
- name: uds-runtime
required: true
charts:
- name: uds-runtime
localPath: ../../../chart
namespace: uds-runtime
version: 0.1.0
actions:
onDeploy:
after:
- description: Validate Runtime Package
maxTotalSeconds: 300
wait:
cluster:
kind: packages.uds.dev
name: uds-runtime
namespace: uds-runtime
condition: "'{.status.phase}'=Ready"
File renamed without changes.
14 changes: 5 additions & 9 deletions zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,23 @@ components:
required: true
only:
flavor: unicorn
import:
path: hack/flavors/common
# x-release-please-start-version
images:
- ghcr.io/defenseunicorns/uds-runtime:0.8.0
# x-release-please-end
charts:
- name: uds-runtime
localPath: ./chart
namespace: uds-runtime
version: 0.1.0
- name: uds-runtime
required: true
only:
flavor: registry1
cluster:
architecture: amd64
import:
path: hack/flavors/common
images:
- registry1.dso.mil/ironbank/opensource/defenseunicorns/uds/runtime:v0.8.0
charts:
- name: uds-runtime
localPath: ./chart
namespace: uds-runtime
version: 0.1.0
valuesFiles:
- values/registry1-values.yaml
- hack/flavors/values/registry1-values.yaml

0 comments on commit 149a9fb

Please sign in to comment.