Skip to content

Commit

Permalink
chore: add tests before publishing a release and remove arm64 archite…
Browse files Browse the repository at this point in the history
…cture (#91)

## Description

Adds tests before publishing a release.

Removes arm64 architecture because it is not supported by mattermost.
See: #92

## Related Issue

Fixes #84 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] 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-mattermost/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
  • Loading branch information
ericwyles and Racer159 committed Jun 12, 2024
1 parent c0e0ca9 commit c136830
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 22 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ jobs:
publish-package:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
name: Publish ${{ matrix.flavor }}
runs-on: ${{ matrix.architecture == 'arm64' && 'uds-ubuntu-arm64-4-core' || 'ubuntu-latest' }}
strategy:
matrix:
flavor: [upstream, registry1]
architecture: [amd64]
name: Publish ${{ matrix.flavor }} ${{ matrix.architecture }}

permissions:
contents: read
Expand All @@ -46,10 +47,14 @@ jobs:
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Package
run: uds run -f tasks/publish.yaml package --set FLAVOR=${{ matrix.flavor }}
run: UDS_ARCHITECTURE=${{ matrix.architecture }} uds run -f tasks/publish.yaml package --set FLAVOR=${{ matrix.flavor }}

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

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
with:
suffix: ${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
suffix: ${{ matrix.flavor }}-${{ matrix.architecture }}-${{ github.run_id }}-${{ github.run_attempt }}
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
flavor: ${{ matrix.flavor }}
type: ${{ matrix.type }}

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

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@4cea6c8858b9f4db3a3624a6fc046db77e1f4eaa # v0.5.0
Expand Down
2 changes: 1 addition & 1 deletion bundle/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ packages:

- name: postgres-operator
repository: ghcr.io/defenseunicorns/packages/uds/postgres-operator
ref: 1.11.0-uds.0-upstream
ref: 1.11.0-uds.1-upstream
overrides:
postgres-operator:
uds-postgres-config:
Expand Down
10 changes: 3 additions & 7 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ tasks:
# CI will execute the following (via uds-common/.github/actions/test) so they need to be here with these names

- name: test-package
description: Test the health of a Mattermost deployment
description: Test deploying the current branch to a new cluster
actions:
- task: create-mm-test-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: setup:create-doug-user
- task: test:health-check
- task: test:ingress
- task: test:ui
- task: test:all

- name: test-upgrade
description: Test an upgrade from the latest released package to the current branch
Expand All @@ -69,6 +67,4 @@ tasks:
- task: deploy:test-bundle
- cmd: ./uds zarf tools kubectl delete pods --all --namespace mattermost
description: "Workaround - restart the pods so the sso configuration will take effect"
- task: test:health-check
- task: test:ingress
- task: test:ui
- task: test:all
23 changes: 13 additions & 10 deletions tasks/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
includes:
- dependencies: ./dependencies.yaml
- test: ./test.yaml
- create: https://github.com/raw/defenseunicorns/uds-common/v0.5.0/tasks/create.yaml
- deploy: https://github.com/raw/defenseunicorns/uds-common/v0.5.0/tasks/deploy.yaml
- publish: https://github.com/raw/defenseunicorns/uds-common/v0.5.0/tasks/publish.yaml
- setup: https://github.com/raw/defenseunicorns/uds-common/v0.5.0/tasks/setup.yaml

tasks:
- name: package
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
actions:
- task: create:package
- task: dependencies:create
- task: create:test-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: setup:create-doug-user
- task: test:all

- description: Publish the packages
- description: Publish the package
task: publish:package
with:
# x-release-please-start-version
Expand Down
6 changes: 6 additions & 0 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
tasks:
- name: all
actions:
- task: health-check
- task: ingress
- task: ui

- name: health-check
actions:
- description: Mattermost Health Check
Expand Down

0 comments on commit c136830

Please sign in to comment.