chore: add common workflows for reuse across repos #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Tasks | |
# This workflow is triggered on pull requests to the main branch. | |
on: | |
pull_request: | |
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 | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Clean Runner | |
uses: ./.github/actions/clean-runner | |
- name: Environment setup | |
uses: ./.github/actions/setup | |
- name: Login to registry1 | |
env: | |
REGISTRY: "registry1.dso.mil" | |
REGISTRY_USERNAME: "${{ secrets.IRON_BANK_ROBOT_USERNAME }}" | |
REGISTRY_PASSWORD: "${{ secrets.IRON_BANK_ROBOT_PASSWORD }}" | |
REGISTRY_RETRY_INTERVAL: "5" | |
run: | | |
uds run registry-login | |
- name: Login to ghcr | |
env: | |
REGISTRY: "ghcr.io" | |
REGISTRY_USERNAME: "dummy" | |
REGISTRY_PASSWORD: "${{ secrets.GITHUB_TOKEN }}" | |
REGISTRY_RETRY_INTERVAL: "5" | |
run: | | |
uds run registry-login | |
- name: Create test package | |
run: uds run create-package --set FLAVOR=test | |
- name: Create test bundle | |
run: uds run create-test-bundle | |
- name: Setup cluster | |
run: uds run setup-cluster | |
- name: Deploy test bundle | |
run: uds run deploy-test-bundle | |
- name: Validate tasks performed as expected | |
run: uds run validate-tasks | |
- name: Save logs | |
if: always() | |
uses: ./.github/actions/save-logs |