Skip to content

Commit

Permalink
chore: change to use uds-common test action (#54)
Browse files Browse the repository at this point in the history
* updates to use latest uds-common actions

* rearrange for clarity

* updates from pr comments

* pull deploy and setup includes from uds-common
  • Loading branch information
ericwyles committed Mar 13, 2024
1 parent 63bb62d commit b16c98a
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 101 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@417b9c2bc088f664c616c9929a2b3ce448d251f7
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@442bae718050ea9a47254851a45632aabeb13b17
66 changes: 0 additions & 66 deletions .github/workflows/pull-requests.yaml

This file was deleted.

16 changes: 11 additions & 5 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,23 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@417b9c2bc088f664c616c9929a2b3ce448d251f7

- name: Iron Bank Login
run: uds zarf tools registry login -u "${{secrets.IRON_BANK_ROBOT_USERNAME}}" -p "${{secrets.IRON_BANK_ROBOT_PASSWORD}}" registry1.dso.mil
uses: defenseunicorns/uds-common/.github/actions/setup@442bae718050ea9a47254851a45632aabeb13b17
with:
username: ${{secrets.IRON_BANK_ROBOT_USERNAME}}
password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}}

- name: Login to GHCR
uses: docker/login-action@v3
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: dummy
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@442bae718050ea9a47254851a45632aabeb13b17
with:
suffix: ${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
62 changes: 62 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test

on:
pull_request:
branches: [main]
types: [milestoned, opened, edited, synchronize]
paths-ignore:
- "**.md"
- "**.jpg"
- "**.png"
- "**.gif"
- "**.svg"
- "adr/**"
- "docs/**"
- ".gitignore"
- "renovate.json"
- ".release-please-config.json"
- "release-please-config.json"
- "oscal-component.yaml"
- "CODEOWNERS"
- "LICENSE"
- "CONTRIBUTING.md"
- "SECURITY.md"

# Abort prior jobs in the same workflow / PR
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
run-test:
name: Create and Deploy Flavor ${{ matrix.flavor }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
flavor: [upstream, registry1]

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@442bae718050ea9a47254851a45632aabeb13b17
with:
username: ${{secrets.IRON_BANK_ROBOT_USERNAME}}
password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}}

- name: Test
uses: defenseunicorns/uds-common/.github/actions/test@442bae718050ea9a47254851a45632aabeb13b17
with:
flavor: ${{ matrix.flavor }}

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@442bae718050ea9a47254851a45632aabeb13b17
with:
suffix: ${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}

30 changes: 16 additions & 14 deletions tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
includes:
- cleanup: ./tasks/cleanup.yaml
- create: ./tasks/create.yaml
- deploy: ./tasks/deploy.yaml
- setup: ./tasks/setup.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common-tasks/v0.2.2/tasks/deploy.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common-tasks/v0.2.2/tasks/setup.yaml
- test: ./tasks/test.yaml

tasks:
Expand All @@ -13,31 +13,33 @@ tasks:
- task: setup-cluster
- task: deploy-test-bundle

- name: setup-cluster
actions:
- task: setup:k3d-test-cluster

- name: create-package
actions:
- task: create:sonarqube-package

- name: deploy-package
actions:
- task: deploy:package

- name: cleanup
actions:
- task: cleanup:destroy

# CI will execute the following (via uds-common/.github/actions/test) so they need to be here with these names

- name: create-test-bundle
actions:
- task: create:sonarqube-test-bundle
- name: deploy-package

- name: setup-cluster
actions:
- task: deploy:sonarqube-package
- task: setup:k3d-test-cluster

- name: deploy-test-bundle
actions:
- task: deploy:sonarqube-test-bundle
- task: deploy:test-bundle

- name: test-package
actions:
- task: test:health-check
- task: test:ingress

- name: cleanup
actions:
- task: cleanup:destroy
10 changes: 0 additions & 10 deletions tasks/deploy.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions tasks/setup.yaml

This file was deleted.

0 comments on commit b16c98a

Please sign in to comment.