Fix trivy #5927
Workflow file for this run
This file contains hidden or 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
| # Copyright 2026 OpenC3, Inc. | |
| # All Rights Reserved. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| # See LICENSE.md for more details. | |
| # This file may also be used under the terms of a commercial license | |
| # if purchased from OpenC3, Inc. | |
| name: Playwright Tests | |
| # Only run on a push to main to avoid running for all the dependabot PRs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - "**" | |
| # Don't cancel playwright because each run can expose different race conditions and issues | |
| # concurrency: | |
| # group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| # cancel-in-progress: true | |
| env: | |
| OPENC3_ARGON2_PROFILE: "unsafe_cheapest" | |
| permissions: | |
| contents: read | |
| jobs: | |
| openc3-build-test: | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: 24 | |
| - name: openc3.sh build | |
| # This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718 | |
| shell: 'script -q -e -c "bash {0}"' | |
| run: ./openc3.sh build | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | |
| with: | |
| version: 10 | |
| - name: Install playwright dependencies | |
| run: ./playwright.sh install-playwright | |
| working-directory: playwright | |
| - name: Check for test.only | |
| run: pnpm playwright test --list --forbid-only | |
| working-directory: playwright | |
| - name: openc3.sh run | |
| # This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718 | |
| shell: 'script -q -e -c "bash {0}"' | |
| run: ./openc3.sh run | |
| # Allow the containers to spin up | |
| - name: Sleep for 2min | |
| run: sleep 120s | |
| shell: bash | |
| # Check container status | |
| - name: Check container status | |
| shell: 'script -q -e -c "bash {0}"' | |
| run: | | |
| docker ps | |
| if docker ps | grep -q Restarting; then | |
| echo "ERROR: One or more containers are restarting" | |
| exit 1 | |
| fi | |
| docker logs cosmos-openc3-cosmos-init-1 | |
| docker logs cosmos-openc3-operator-1 | |
| docker logs cosmos-openc3-cosmos-cmd-tlm-api-1 | |
| docker logs cosmos-openc3-cosmos-script-runner-api-1 | |
| if docker ps | grep -q unhealthy; then | |
| echo "ERROR: One or more containers are unhealthy" | |
| exit 1 | |
| fi | |
| # Build a test plugin for playwright and a copy so we can 'upgrade' | |
| - name: Build plugin | |
| shell: 'script -q -e -c "bash {0}"' | |
| run: ./playwright.sh build-plugin | |
| working-directory: playwright | |
| # Ensure we're connected and running | |
| - name: Wait for build | |
| run: pnpm playwright test --project=chromium tests/wait-for-build.spec.ts | |
| working-directory: playwright | |
| - name: Run Playwright tests | |
| # Run separately to allow for parallelism | |
| run: ./playwright.sh run-chromium --grep-invert='enterprise' | |
| working-directory: playwright | |
| - name: Generate coverage | |
| run: pnpm fixlinux; pnpm cobertura | |
| working-directory: playwright | |
| - uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3 | |
| with: | |
| directory: playwright/coverage | |
| flags: frontend # See codecov.yml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test artifacts | |
| if: always() # Upload on pass or fail | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: playwright | |
| path: playwright/test-results | |
| retention-days: 30 |