test: harden flaky restart and startup checks #96
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
| name: PR Checks | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Run Tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24.1' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run linterTests | |
| run: make lint | |
| - name: Run tests | |
| run: make test | |
| test-ui-components: | |
| runs-on: ubuntu-latest | |
| name: UI Component Tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Install dependencies | |
| run: cd ui && npm ci | |
| - name: Install Playwright browsers | |
| run: cd ui && npx playwright install chromium --with-deps | |
| - name: Run component tests | |
| run: cd ui && npm run test:ct | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: ui/playwright-report/ | |
| retention-days: 7 | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| name: Build & Push Image (PR) | |
| needs: [test, test-ui-components] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get commit SHA | |
| id: commit | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: false | |
| tags: ghcr.io/moolen/spectre:pr-${{ github.event.pull_request.number }}-${{ steps.commit.outputs.sha_short }} | |
| outputs: type=docker,dest=/tmp/image.tar | |
| - name: Upload image artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-image | |
| path: /tmp/image.tar | |
| retention-days: 1 |