Skip to content

Commit

Permalink
chore: add pre release testing (#40)
Browse files Browse the repository at this point in the history
## Description

Adds testing before publishing the release

## Related Issue

Fixes #31 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/uds-package-postgres-operator/blob/main/CONTRIBUTING.md#developer-workflow)
followed
  • Loading branch information
ericwyles authored Jun 21, 2024
1 parent c88f9fd commit ac40af4
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ on:
jobs:
validate:
name: Validate
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
fetch-depth: 0

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/setup@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Install lint deps
run: |
uds run lint:deps
uds run lint:deps --no-progress
- name: Lint the repository
run: |
uds run lint:yaml
uds run lint:yaml --no-progress
16 changes: 12 additions & 4 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ jobs:
publish-package:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.architecture == 'arm64' && 'uds-ubuntu-arm64-4-core' || 'ubuntu-latest' }}
name: Publish ${{ matrix.flavor }}
strategy:
matrix:
flavor: [upstream, registry1]
architecture: [amd64, arm64]
exclude:
- flavor: registry1
architecture: arm64

permissions:
contents: read
Expand All @@ -40,7 +44,7 @@ jobs:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/setup@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
Expand All @@ -49,8 +53,12 @@ jobs:
- name: Publish Package
run: uds run -f tasks/publish.yaml package --set FLAVOR=${{ matrix.flavor }}

- name: Debug Output
if: ${{ always() }}
uses: defenseunicorns/uds-common/.github/actions/debug-output@0901c37366f37fea586768c79708e14e964e714e # v0.6.1

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/save-logs@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
with:
suffix: ${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
suffix: ${{ matrix.flavor }}-${{ matrix.architecture }}-${{ github.run_id }}-${{ github.run_attempt }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ jobs:
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/setup@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Test
uses: defenseunicorns/uds-common/.github/actions/test@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/test@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
with:
flavor: ${{ matrix.flavor }}
type: ${{ matrix.type }}

- name: Debug Output
if: ${{ always() }}
uses: defenseunicorns/uds-common/.github/actions/debug-output@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/debug-output@0901c37366f37fea586768c79708e14e964e714e # v0.6.1

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
uses: defenseunicorns/uds-common/.github/actions/save-logs@0901c37366f37fea586768c79708e14e964e714e # v0.6.1
with:
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
16 changes: 7 additions & 9 deletions tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
includes:
- dependencies: ./tasks/dependencies.yaml
- test: ./tasks/test.yaml
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/create.yaml
- lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/lint.yaml
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/pull.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/deploy.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/setup.yaml
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/create.yaml
- lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/lint.yaml
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/pull.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/deploy.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/setup.yaml

tasks:
- name: default
Expand Down Expand Up @@ -54,8 +54,7 @@ tasks:
- task: create-pg-test-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: test:health-check
- task: test:create-dbs
- task: test:all

- name: test-upgrade
description: Test an upgrade from the latest released package to the current branch
Expand All @@ -65,5 +64,4 @@ tasks:
- task: deploy:test-bundle
- task: create-pg-test-bundle
- task: deploy:test-bundle
- task: test:health-check
- task: test:create-dbs
- task: test:all
25 changes: 13 additions & 12 deletions tasks/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
includes:
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/create.yaml
- publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/publish.yaml
- dependencies: ./dependencies.yaml
- test: ./test.yaml
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/create.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/deploy.yaml
- publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/publish.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.1/tasks/setup.yaml

tasks:
- name: package
description: Build and publish the packages
description: Build, test, and publish the package
actions:
- description: Create the AMD64 package
task: create:package
with:
architecture: amd64

- description: Create the ARM64 package
task: create:package
with:
architecture: arm64
- task: create:package
- task: dependencies:create
- task: create:test-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: test:all

- description: Publish the packages
task: publish:package
Expand Down
5 changes: 5 additions & 0 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
tasks:
- name: all
actions:
- task: health-check
- task: create-dbs

- name: create-dbs
actions:
- description: Create the DB test package for the PG instance
Expand Down

0 comments on commit ac40af4

Please sign in to comment.