Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add upgrade tests to common #91

Merged
merged 8 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@
}
],
"packageRules": [
{
zachariahmiller marked this conversation as resolved.
Show resolved Hide resolved
"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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading