[ENG-2185] Adding Consent #5847
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: Privacy Center Cypress Tests | |
| on: | |
| pull_request: | |
| merge_group: | |
| types: [checks_requested] | |
| push: | |
| branches: | |
| - "main" | |
| - "release-**" | |
| env: | |
| CI: true | |
| jobs: | |
| Check-Privacy-Center-Changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_privacy_center_changes: ${{ steps.filter.outputs.privacy_center }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for Privacy Center file changes | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| list-files: shell | |
| filters: | | |
| privacy_center: | |
| - 'clients/privacy-center/**' | |
| - '!clients/privacy-center/pages/api/fides-js.ts' | |
| - '.github/workflows/cypress_privacy-center.yml' | |
| - name: Log changed files | |
| if: steps.filter.outputs.privacy_center == 'true' | |
| run: echo "${{ steps.filter.outputs.privacy_center_files }}" | |
| Privacy-Center-Cypress: | |
| needs: Check-Privacy-Center-Changes | |
| if: needs.Check-Privacy-Center-Changes.outputs.has_privacy_center_changes == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: clients | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20.x | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build FidesJS | |
| working-directory: clients/fides-js | |
| run: npm run build:test | |
| - name: Build NextJS | |
| working-directory: clients/privacy-center | |
| run: npm run build:test | |
| - name: Cypress Privacy Center E2E Tests | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| working-directory: clients/privacy-center | |
| install: false | |
| start: npm run start:test | |
| wait-on: "http://localhost:3001" | |
| wait-on-timeout: 180 | |
| spec: cypress/e2e/privacy-center/** | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: cypress-videos-privacy-center | |
| path: /home/runner/work/fides/fides/clients/privacy-center/cypress/videos/*.mp4 | |
| Privacy-Center-Cypress-Summary: | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - Privacy-Center-Cypress | |
| steps: | |
| - name: Check job results | |
| run: | | |
| echo "Privacy-Center-Cypress: ${{ needs.Privacy-Center-Cypress.result }}" | |
| # Fail only if jobs failed (not if skipped) | |
| if [ "${{ needs.Privacy-Center-Cypress.result }}" == "failure" ]; then | |
| echo "❌ One or more required jobs failed" | |
| exit 1 | |
| fi | |
| # Check for cancelled jobs (treat as failure) | |
| if [ "${{ needs.Privacy-Center-Cypress.result }}" == "cancelled" ]; then | |
| echo "❌ One or more required jobs were cancelled" | |
| exit 1 | |
| fi | |
| echo "✅ All required Privacy Center Cypress checks passed or were skipped" |