name: CI on: push: branches: [main] tags: ['v*'] pull_request: workflow_dispatch: concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: test: runs-on: ubuntu-latest defaults: run: working-directory: server steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 22 cache: npm cache-dependency-path: server/package-lock.json - run: npm ci - run: npm test smoke: # Browser-Smoketest (scripts/smoke.mjs): eigener Job, läuft parallel zu „test“ und bremst ihn nicht. # Playwright ist kein Teil der Abhängigkeiten – hier nur für diesen Lauf installiert, Chromium wird zwischengespeichert. runs-on: ubuntu-latest timeout-minutes: 6 defaults: run: working-directory: server env: PLAYWRIGHT_VERSION: 1.63.0 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 22 cache: npm cache-dependency-path: server/package-lock.json - run: npm ci - run: npm install --no-save --no-audit --no-fund playwright@${{ env.PLAYWRIGHT_VERSION }} - id: pwcache uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ~/.cache/ms-playwright key: playwright-${{ runner.os }}-${{ env.PLAYWRIGHT_VERSION }}-chromium-shell - if: steps.pwcache.outputs.cache-hit != 'true' run: npx playwright install --with-deps --only-shell chromium - if: steps.pwcache.outputs.cache-hit == 'true' run: npx playwright install-deps chromium - run: node scripts/smoke.mjs --shots smoke-shots - if: failure() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: smoke-screenshots path: server/smoke-shots retention-days: 7 image: # Multi-Arch-Image (amd64 + arm64 für den Raspberry Pi) nach ghcr.io – nur nach erfolgreichen Tests und Smoketest auf main/Tags needs: [test, smoke] if: github.event_name != 'pull_request' runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - id: built run: echo "at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT" - id: meta uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 with: images: ghcr.io/${{ github.repository }} tags: | type=raw,value=latest,enable={{is_default_branch}} type=sha,format=short type=semver,pattern={{version}} - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 with: context: . platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ github.sha }} BUILT_AT=${{ steps.built.outputs.at }} cache-from: type=gha cache-to: type=gha,mode=max