feat: adds playwright testing #251
Workflow file for this run
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 | |
# This workflow is triggered on pull requests to the main branch. | |
on: | |
pull_request: | |
branches: [main] | |
types: [milestoned, opened, 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: ${{ matrix.type }} ${{ matrix.flavor }} | |
runs-on: uds-marketplace-ubuntu-big-boy-8-core | |
timeout-minutes: 25 | |
strategy: | |
matrix: | |
flavor: [registry1] | |
type: [install, upgrade] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Environment setup | |
uses: defenseunicorns/uds-common/.github/actions/setup@772b3337950b7c8e0882c527263684306bba7ce4 # v0.7.1 | |
with: | |
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} | |
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} | |
ghToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test | |
uses: defenseunicorns/uds-common/.github/actions/test@772b3337950b7c8e0882c527263684306bba7ce4 # v0.7.1 | |
with: | |
flavor: ${{ matrix.flavor }} | |
type: ${{ matrix.type }} | |
- name: Save logs | |
if: always() | |
uses: defenseunicorns/uds-common/.github/actions/save-logs@772b3337950b7c8e0882c527263684306bba7ce4 # v0.7.1 | |
with: | |
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }} | |
- name: Print cluster info | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl get nodes -o wide | |
- name: Print pod info | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl get pods -A -o wide | |
- name: Print service info | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl get svc -A -o wide | |
- name: Print events | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl get events -A -o wide | |
- name: Print Jenkins pod logs | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl logs jenkins-0 -n jenkins | |
- name: Print Jenkins OIC configmap | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl get configmap jenkins-jenkins-config-keycloak -n jenkins -o yaml | |
- name: Print Jenkins OIC secret | |
if: always() | |
shell: bash -e -o pipefail {0} | |
run: | | |
kubectl get secrets sso-client-uds-package-jenkins -n jenkins -o=jsonpath='{.data.secret}' | base64 -d | |
- name: Upload screenshot on failure | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: playwright-screenshot | |
path: tests/screenshots/* |