diff --git a/.github/workflows/flavor-tests.yaml b/.github/workflows/flavor-tests.yaml new file mode 100644 index 00000000..8847e954 --- /dev/null +++ b/.github/workflows/flavor-tests.yaml @@ -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 }} + 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 }} diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 2d63c369..16acf8cb 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -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 diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index f6c23bea..85eeb989 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -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 }} @@ -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 diff --git a/hack/flavors/common/zarf.yaml b/hack/flavors/common/zarf.yaml new file mode 100644 index 00000000..1fe3e100 --- /dev/null +++ b/hack/flavors/common/zarf.yaml @@ -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" diff --git a/values/registry1-values.yaml b/hack/flavors/values/registry1-values.yaml similarity index 100% rename from values/registry1-values.yaml rename to hack/flavors/values/registry1-values.yaml diff --git a/zarf.yaml b/zarf.yaml index d4be958a..c22933eb 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -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