chore: cache playwright and add tests to amd64 release #510
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-ubuntu-big-boy-8-core | |
timeout-minutes: 25 | |
strategy: | |
matrix: | |
flavor: [upstream, registry1] | |
type: [install, upgrade] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Environment setup | |
uses: defenseunicorns/uds-common/.github/actions/setup@11e591f2ec7d158923d973c85097ce28a5f55db4 # v0.4.5 | |
with: | |
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} | |
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} | |
ghToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./tests/package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV | |
- name: Cache playwright binaries | |
uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- run: npm ci | |
- run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- run: npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Test | |
uses: defenseunicorns/uds-common/.github/actions/test@11e591f2ec7d158923d973c85097ce28a5f55db4 # v0.4.5 | |
with: | |
flavor: ${{ matrix.flavor }} | |
type: ${{ matrix.type }} | |
- name: Save logs | |
if: always() | |
uses: defenseunicorns/uds-common/.github/actions/save-logs@11e591f2ec7d158923d973c85097ce28a5f55db4 # v0.4.5 | |
with: | |
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }} | |
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
if: always() | |
with: | |
name: playwright-report-${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }} | |
path: tests/.playwright/reports/ | |
retention-days: 30 |