From e84535613cb63243618faf6a6db1b628abc18677 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 7 Oct 2024 11:59:08 -0600 Subject: [PATCH 1/5] fix: update the publish task to avoid name collision --- .github/workflows/callable-publish.yaml | 7 +- .github/workflows/callable-test.yaml | 5 +- .github/workflows/release.yaml | 1 + tasks.yaml | 90 +++++++++++++------------ 4 files changed, 56 insertions(+), 47 deletions(-) diff --git a/.github/workflows/callable-publish.yaml b/.github/workflows/callable-publish.yaml index aaa7a653..cf8eaa11 100644 --- a/.github/workflows/callable-publish.yaml +++ b/.github/workflows/callable-publish.yaml @@ -3,13 +3,16 @@ name: Callable-Publish on: workflow_call: inputs: + runsOn: + default: ubuntu-latest + type: string flavor: required: true type: string jobs: run: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runsOn }} permissions: contents: read packages: write @@ -34,7 +37,7 @@ jobs: shell: bash - name: Publish Package - run: uds run publish --set FLAVOR=${{ inputs.flavor }} --no-progress + run: uds run publish-package --set FLAVOR=${{ inputs.flavor }} --no-progress - name: Save logs if: ${{ always() }} diff --git a/.github/workflows/callable-test.yaml b/.github/workflows/callable-test.yaml index 9207174e..a3d1aa6d 100644 --- a/.github/workflows/callable-test.yaml +++ b/.github/workflows/callable-test.yaml @@ -3,6 +3,9 @@ name: Callable-Test on: workflow_call: inputs: + runsOn: + default: ubuntu-latest + type: string upgrade-flavors: required: true type: string @@ -26,7 +29,7 @@ permissions: jobs: run: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runsOn }} timeout-minutes: 20 if: contains(inputs.upgrade-flavors, inputs.flavor) || inputs.type == 'install' diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 93258cbe..3452099c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,6 +34,7 @@ jobs: strategy: matrix: flavor: [upstream, registry1, unicorn] + architecture: [amd64] uses: ./.github/workflows/callable-publish.yaml with: flavor: ${{ matrix.flavor }} diff --git a/tasks.yaml b/tasks.yaml index 44a2db08..4758da4d 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -25,53 +25,19 @@ tasks: - task: setup:k3d-full-cluster - task: deploy:test-bundle - - name: create-package + - name: create-dev-package description: Create UDS nginx Package actions: - task: create:package with: options: --skip-sbom - - name: create-test-bundle - description: Create a local UDS nginx bundle - actions: - - task: create-package - - task: create:test-bundle - - - name: create-latest-release-bundle - description: Create UDS nginx bundle based on the latest release - actions: - - task: pull:latest-package-release - with: - spoof_release: "true" - - task: create:test-bundle - - name: dev description: Create and deploy the bundle against an existing cluster actions: - task: create-test-bundle - task: deploy:test-bundle - - name: publish - description: Build and publish the packages - actions: - - description: Create the AMD64 package - task: create:package - with: - architecture: amd64 - - - description: Create the ARM64 package - task: create:package - with: - architecture: arm64 - - - description: Publish the packages - task: publish:package - with: - # x-release-please-start-version - version: 0.13.1 - # x-release-please-end - - name: test description: Test and validate cluster is deployed with nginx actions: @@ -81,16 +47,34 @@ tasks: address: nginx.uds.dev code: 200 -# CI will execute the following (via .github/actions/test) so they need to be here with these names + - name: create-deploy-test-bundle + description: Test and validate cluster is deployed with nginx + actions: + - description: Create the test bundle + task: create:test-bundle + + - description: Deploy the test bundle + task: deploy:test-bundle + + - description: Test the bundle + task: test + +# CI will execute the following (via .github/actions/test and .github/actions/release) so they need to be here with these names - name: test-package description: Test the nginx package from the current branch actions: - - task: create-test-bundle - - task: setup:k3d-test-cluster - - task: deploy:test-bundle - - task: test - - task: compliance:validate + - description: Create a dev version of the package + task: create-dev-package + + - description: Setup the cluster + task: setup:k3d-test-cluster + + - description: Create deploy and test the bundle + task: create-deploy-test-bundle + + - description: Validate OSCAL compliance + task: compliance:validate with: assessment_results: /tmp/oscal-assessment-results.yaml @@ -103,12 +87,30 @@ tasks: - task: compliance:validate with: assessment_results: /tmp/oscal-assessment-results.yaml - - task: create-test-bundle - - task: deploy:test-bundle - - task: test + - task: create-dev-package + - task: create-deploy-test-bundle - task: compliance:validate with: assessment_results: /tmp/oscal-assessment-results.yaml - task: compliance:evaluate with: assessment_results: /tmp/oscal-assessment-results.yaml + + - name: publish-package + description: Build and publish the packages + actions: + - description: Create the package + task: create:package + + - description: Setup the cluster + task: setup:k3d-test-cluster + + - description: Create deploy and test the bundle + task: create-deploy-test-bundle + + - description: Publish the packages + task: publish:package + with: + # x-release-please-start-version + version: 0.13.1 + # x-release-please-end From f4aee49d22e7403c5677306a466887bb7281bb5d Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 7 Oct 2024 12:05:21 -0600 Subject: [PATCH 2/5] lint --- tasks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.yaml b/tasks.yaml index 6a66dfd9..fade9658 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -72,7 +72,7 @@ tasks: - description: Create deploy and test the bundle task: create-deploy-test-bundle - + - description: Validate OSCAL compliance task: compliance:validate with: From c3fd0b92cefa760a466028bd4edff8d37209ee93 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 7 Oct 2024 12:08:35 -0600 Subject: [PATCH 3/5] add arm publish --- .github/workflows/release.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3452099c..b2ad65d0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,8 +34,12 @@ jobs: strategy: matrix: flavor: [upstream, registry1, unicorn] - architecture: [amd64] + architecture: [amd64, arm64] + exclude: + - flavor: registry1 + architecture: arm64 uses: ./.github/workflows/callable-publish.yaml with: flavor: ${{ matrix.flavor }} + runsOn: ${{ matrix.architecture == 'arm64' && 'uds-swf-ubuntu-arm64-4-core' || 'ubuntu-latest' }} secrets: inherit # Inherits all secrets from the parent workflow. From 6e6da1a13d8c097a3bf7af6b19cc1c6e468371b9 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 7 Oct 2024 12:12:14 -0600 Subject: [PATCH 4/5] add concurrency back --- .github/workflows/test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 75da4abb..a930b2ed 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,6 +29,11 @@ permissions: packages: read # Allows reading the content of the repository's packages. id-token: write +# Abort prior jobs in the same workflow / PR +concurrency: + group: test-${{ github.ref }} + cancel-in-progress: true + jobs: check-flavor: runs-on: ubuntu-latest From 164149298d6e06cb8333b3b53b33e953c101d304 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 7 Oct 2024 12:14:51 -0600 Subject: [PATCH 5/5] Update tasks.yaml Co-authored-by: zamaz <71521611+zachariahmiller@users.noreply.github.com> --- tasks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.yaml b/tasks.yaml index fade9658..4ca4bb26 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -59,7 +59,7 @@ tasks: - description: Test the bundle task: test -# CI will execute the following (via .github/actions/test and .github/actions/release) so they need to be here with these names +# CI will execute the following (via .github/workflows/callable-test.yaml and .github/workflows/callable-publish.yaml) so they need to be here with these names - name: test-package description: Test the nginx package from the current branch