Skip to content

Commit

Permalink
chore: add upgrade tests to common (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed Mar 28, 2024
1 parent b8d8181 commit bb2e590
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/actions/test/action.yaml
Expand Up @@ -20,12 +20,12 @@ runs:

- name: Test installing the package
if: ${{ inputs.type == 'install' }}
run: uds run test-package --set FLAVOR=${{ inputs.flavor }} ${{ inputs.options }}
run: uds run test-package --set FLAVOR=${{ inputs.flavor }} ${{ inputs.options }} --no-progress
shell: bash

# === UPGRADE TESTING ===

- name: Test upgrading the package
if: ${{ inputs.type == 'upgrade' }}
run: uds run test-upgrade --set FLAVOR=${{ inputs.flavor }} ${{ inputs.options }}
run: uds run test-upgrade --set FLAVOR=${{ inputs.flavor }} ${{ inputs.options }} --no-progress
shell: bash
35 changes: 35 additions & 0 deletions .github/workflows/ci-docs-shim.yaml
@@ -0,0 +1,35 @@
name: CI Docs Shim

on:
pull_request:
paths:
- "**.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

jobs:
run-test:
name: ${{ matrix.type }} ${{ matrix.flavor }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
flavor: [test]
type: [install, upgrade]
steps:
- name: Shim for ${{ matrix.type }} ${{ matrix.flavor }}
run: |
echo "Documentation-only change detected; marking ${{ matrix.type }} ${{ matrix.flavor }} as successful."
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Expand Up @@ -29,8 +29,8 @@ jobs:

- 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
2 changes: 1 addition & 1 deletion .github/workflows/tag-release.yaml
Expand Up @@ -48,7 +48,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Package
run: uds run publish-podinfo --set FLAVOR=${{ matrix.flavor }}
run: uds run publish-podinfo --set FLAVOR=${{ matrix.flavor }} --no-progress

- name: Save logs
if: always()
Expand Down
32 changes: 27 additions & 5 deletions .github/workflows/test-deploy.yaml
@@ -1,26 +1,45 @@
name: Test Tasks
name: Test

on:
# This workflow is triggered on pull requests to the main branch.
pull_request:
# milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow).
types: [milestoned, opened, reopened, 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

concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true

# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
id-token: write # Needed for OIDC-related operations.
contents: read # Allows reading the content of the repository.
pull-requests: read # Allows reading pull request metadata.

jobs:
run-test:
name: Test
name: ${{ matrix.type }} ${{ matrix.flavor }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
flavor: [test]
type: [install, upgrade]

steps:
- name: Checkout repository
Expand All @@ -39,8 +58,11 @@ jobs:
- name: Test
uses: ./.github/actions/test
with:
flavor: test
flavor: ${{ matrix.flavor }}
type: ${{ matrix.type }}

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
with:
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
7 changes: 7 additions & 0 deletions config/renovate.json5
Expand Up @@ -218,6 +218,13 @@
{
"matchPackageNames": ["registry1.dso.mil/ironbank/big-bang/base"],
"allowedVersions": "!/8.4/"
},
{
"matchFileNames": [".github/**"],
"excludePackageNames": ["defenseunicorns/uds-cli"],
"groupName": "githubactions",
"commitMessageTopic": "githubactions",
"pinDigests": true
}
]
}
17 changes: 11 additions & 6 deletions renovate.json
Expand Up @@ -41,12 +41,17 @@
}
],
"packageRules": [
{
"matchFileNames": [".github/**"],
"excludePackageNames": ["defenseunicorns/uds-cli"],
"groupName": "githubactions",
"commitMessageTopic": "githubactions",
"pinDigests": true
{
"groupName": "UDS Common Support Dependencies",
"labels": ["support-deps"],
"commitMessageTopic": "support-deps",
"packagePatterns": ["*"]
},
{
"groupName": "UDS Common Package Dependencies",
"labels": ["package-deps"],
"commitMessageTopic": "package-deps",
"matchPackagePatterns": [".*podinfo.*"]
}
]
}
19 changes: 19 additions & 0 deletions tasks.yaml
Expand Up @@ -4,6 +4,7 @@ includes:
- deploy: ./tasks/deploy.yaml
- lint: ./tasks/lint.yaml
- publish: ./tasks/publish.yaml
- pull: ./tasks/pull.yaml

tasks:
- name: create-podinfo-package
Expand All @@ -19,6 +20,14 @@ tasks:
- task: create-podinfo-package
- task: create:test-bundle

- name: create-podinfo-latest-release-bundle
description: Create UDS Podinfo bundle based on the latest release
actions:
- task: pull:latest-package-release
with:
spoof_release: "true"
- task: create:test-bundle

- name: publish-podinfo
description: Build and publish the packages
actions:
Expand Down Expand Up @@ -58,3 +67,13 @@ tasks:
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: test

- name: test-upgrade
description: Test an upgrade from the latest released package to the current branch
actions:
- task: create-podinfo-latest-release-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: create-podinfo-test-bundle
- task: deploy:test-bundle
- task: test
2 changes: 1 addition & 1 deletion tasks/create.yaml
Expand Up @@ -39,7 +39,7 @@ tasks:
actions:
- cmd: |
if [ ${FLAVOR} != "registry1" ] || [ ${{ .inputs.architecture }} != "arm64" ]; then
UDS_CONFIG=${{ .inputs.path }}/${{ .inputs.config }} uds create ${{ .inputs.path }} --confirm --no-progress --architecture=${{ .inputs.architecture }} ${{ .inputs.options }}
UDS_CONFIG=${{ .inputs.path }}/${{ .inputs.config }} uds create ${{ .inputs.path }} --confirm --no-progress --architecture=${{ .inputs.architecture }} ${{ .inputs.options }} --no-tea
else
echo "Registry1 bundles cannot be made for 'arm64'"
fi
2 changes: 1 addition & 1 deletion tasks/deploy.yaml
Expand Up @@ -22,4 +22,4 @@ tasks:
description: For setting deploy time variables and flags
actions:
- description: Deploy the UDS bundle with the package and its dependencies
cmd: UDS_CONFIG=${{ .inputs.path }}/${{ .inputs.config }} uds deploy ${{ .inputs.path }}/uds-bundle-*-${UDS_ARCH}-*.tar.zst --confirm --no-progress ${{ .inputs.options }}
cmd: UDS_CONFIG=${{ .inputs.path }}/${{ .inputs.config }} uds deploy ${{ .inputs.path }}/uds-bundle-*-${UDS_ARCH}-*.tar.zst --confirm --no-progress ${{ .inputs.options }} --no-tea
4 changes: 2 additions & 2 deletions tasks/publish.yaml
Expand Up @@ -38,7 +38,7 @@ tasks:
actions:
- description: Publish bundles for the amd64 and arm64 architectures
cmd: |
uds publish ${{ .inputs.path }}/uds-bundle-*-amd64-${{ .inputs.version }}.tar.zst oci://${{ .inputs.target_repo }} --no-progress
uds publish ${{ .inputs.path }}/uds-bundle-*-amd64-${{ .inputs.version }}.tar.zst oci://${{ .inputs.target_repo }} --no-progress --no-tea
if [ ${FLAVOR} != "registry1" ]; then
uds publish ${{ .inputs.path }}/uds-bundle-*-arm64-${{ .inputs.version }}.tar.zst oci://${{ .inputs.target_repo }} --no-progress
uds publish ${{ .inputs.path }}/uds-bundle-*-arm64-${{ .inputs.version }}.tar.zst oci://${{ .inputs.target_repo }} --no-progress --no-tea
fi
2 changes: 1 addition & 1 deletion tasks/setup.yaml
Expand Up @@ -7,4 +7,4 @@ tasks:
actions:
- description: Create k3d cluster with UDS Core Istio
# renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver
cmd: uds deploy oci://defenseunicorns/uds/bundles/k3d-core-slim-dev:0.17.0 --confirm --no-progress
cmd: uds deploy oci://defenseunicorns/uds/bundles/k3d-core-slim-dev:0.17.0 --confirm --no-progress --no-tea

0 comments on commit bb2e590

Please sign in to comment.