fix(GAT-9334): Update dompurify version #432
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 Isolated E2E Tests | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| api_branch: | |
| description: "Branch of gateway-api to check out" | |
| required: false | |
| default: "dev" | |
| env: | |
| APP_ENV: "dev" | |
| APP_DEBUG: "true" | |
| APP_NAME: "gateway-api-2" | |
| AUDIT_LOG_ENABLED: "true" | |
| APP_URL: "http://localhost:8000" | |
| ZURE_PROXY: "false" | |
| BROADCAST_DRIVER: "log" | |
| CORS_ACCESS_CONTROL_ALLOW_ORIGIN: "http://localhost:3000" | |
| CACHE_DRIVER: "file" | |
| DB_CONNECTION: "mysql" | |
| DB_DATABASE: "hdrgatewaydev" | |
| DB_HOST: "127.0.0.1" | |
| DB_PORT: "3306" | |
| DB_USERNAME: "root" | |
| DB_PASSWORD: "root" | |
| ELASTICSEARCH_VERIFY_SSL: "false" | |
| ELASTIC_SERVICE_URL: ${{ secrets.ELASTIC_SERVICE_URL }} | |
| ELASTICSEARCH_USER: ${{ secrets.ELASTICSEARCH_USER }} | |
| ELASTICSEARCH_PASS: ${{ secrets.ELASTICSEARCH_PASS }} | |
| FILESYSTEM_DISK: "local" | |
| FORM_HYDRATION_SCHEMA_URL: "https://raw.githubusercontent.com/HDRUK/schemata-2/master/docs/%s/%s.form.json" | |
| FORM_HYDRATION_SCHEMA_MODEL: "HDRUK" | |
| FORM_HYDRATION_SCHEMA_LATEST_VERSION: "4.0.0" | |
| GATEWAY_API_USER_ID: 2 | |
| GATEWAY_LOGOUT_URL: "http://localhost:3000" | |
| GATEWAY_URL: "http://localhost:3000" | |
| SCANNING_FILESYSTEM_DISK: "local_scan" | |
| CLAMAV_API_URL: "https://hdr-gateway-scanning-dev-qmnkcg5qjq-ew.a.run.app" | |
| SDEConciergeServiceEnquiry: "true" | |
| GWDM: "GWDM" | |
| GWDM_TRASER_IDENT: "gdmv1" | |
| GWDM_CURRENT_VERSION: "2.0" | |
| APP_KEY: ${{ secrets.APP_KEY }} | |
| JWT_KID: ${{ secrets.JWT_KID }} | |
| JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
| MAIL_MAILER: "smtp" | |
| MAIL_HOST: "127.0.0.1" | |
| MAIL_PORT: "1025" | |
| MAIL_USERNAME: | |
| MAIL_PASSWORD: | |
| MAIL_ENCRYPTION: null | |
| MAIL_FROM_ADDRESS: "noreply@healthdatagateway.org" | |
| MAIL_FROM_NAME: "gateway-api-2" | |
| MEMCACHED_HOST: "127.0.0.1" | |
| MJML_RENDER_URL: "https://europe-west1-hdrukshareddev.cloudfunctions.net/hdr-shared-mjml-dev" | |
| QUEUE_CONNECTION: "database" | |
| REDIS_CLIENT: "phpredis" | |
| REDIS_HOST: "localhost" | |
| REDIS_PASSWORD: "mypassword" | |
| REDIS_PORT: "6379" | |
| SEARCH_SERVICE_URL: ${{ secrets.SEARCH_SERVICE_URL }} | |
| TED_ENABLED: "true" | |
| TED_SERVICE_URL: ${{ secrets.TED_SERVICE_URL }} | |
| TRASER_ENABLED: "true" | |
| TRASER_SERVICE_URL: ${{ secrets.TRASER_SERVICE_URL }} | |
| MEDIA_URL: "https://media.dev.hdruk.cloud" | |
| COHORT_DISCOVERY_ACCESS_URL: "http://localhost:3000/en/about/cohort-discovery" | |
| COHORT_DISCOVERY_RENEW_URL: "http://localhost:3000/en/about/cohort-discovery" | |
| AZURE_PROXY: "false" | |
| CYPRESS_BASE_URL: "http://localhost:3000/en" | |
| isTest: "true" | |
| TEST_USER_PASSWORD: "3pFOx4a6D464" | |
| NEXT_PUBLIC_API_V1_URL: "http://localhost:8000/api/v1" | |
| NEXT_PUBLIC_API_V1_IP_URL: "http://localhost:8000/api/v1" | |
| NEXT_PUBLIC_API_V2_URL: "http://localhost:8000/api/v2" | |
| NEXT_PUBLIC_API_V2_IP_URL: "http://localhost:8000/api/v2" | |
| NEXT_PUBLIC_API_V3_URL: "http://localhost:8000/api/v3" | |
| NEXT_PUBLIC_API_V3_IP_URL: "http://localhost:8000/api/v3" | |
| NEXT_PUBLIC_WORDPRESS_API_URL: ${{ secrets.NEXT_PUBLIC_WORDPRESS_API_URL }} | |
| NEXT_PUBLIC_SERVICE_DESK_URL: ${{ secrets.NEXT_PUBLIC_SERVICE_DESK_URL }} | |
| NEXT_PUBLIC_GATEWAY_URL: "http://localhost:3000" | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| NEXT_PUBLIC_API_VERSION: "v1" | |
| NEXT_PUBLIC_SCHEMA_NAME: "HDRUK" | |
| NEXT_PUBLIC_SCHEMA_VERSION: "4.0.0" | |
| NEXT_PUBLIC_MEDIA_URL: ${{ secrets.NEXT_PUBLIC_MEDIA_URL }} | |
| NEXT_PUBLIC_INCLUDE_BANNERS: "false" | |
| NEXT_PUBLIC_MEDIA_DOMAIN: "http://localhost/storage" | |
| NEXT_PUBLIC_MEDIA_STATIC_URL: ${{ secrets.NEXT_PUBLIC_MEDIA_STATIC_URL }} | |
| NEXT_PUBLIC_CMS_LINK_HOSTNAME: "www.healthdatagateway.org" | |
| NEXT_PUBLIC_CONFLUENCE_URL: ${{ secrets.NEXT_PUBLIC_CONFLUENCE_URL }} | |
| NEXT_PUBLIC_API_BASE_URL: "http://localhost:8000/api" | |
| DEV_EMAIL: "CypressDevelopers@hdruk.ac.uk" | |
| CUST_ADMIN_1_EMAIL: "CypressTeamAdmin@hdruk.ac.uk" | |
| METADATA_MANAGER_EMAIL: "CypressMetaDataManager@hdruk.ac.uk" | |
| DAR_MANAGER_AND_METADATA_MANAGER_EMAIL: "CypressDarMetadataManager@hdruk.ac.uk" | |
| SUPERUSER_EMAIL: "CypressSuperUser@hdruk.ac.uk" | |
| jobs: | |
| e2e-tests: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.state == 'open' && github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| environment: cypress_dev | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_DATABASE: hdrgatewaydev | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost" | |
| --health-interval=5s | |
| --health-timeout=2s | |
| --health-retries=5 | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd="redis-cli -a mypassword ping" | |
| --health-interval=5s | |
| --health-timeout=2s | |
| --health-retries=5 | |
| env: | |
| REDIS_PASSWORD: mypassword | |
| steps: | |
| - name: Install MailDev | |
| run: npm install -g maildev | |
| - name: Start MailDev | |
| run: | | |
| nohup maildev --smtp=1025 --web=8025 > maildev.log 2>&1 & | |
| sleep 5 | |
| - name: Checkout web | |
| uses: actions/checkout@v4 | |
| - name: Generate GitHub App token | |
| id: generate-deployment-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.DEPLOY_APP_ID }} | |
| private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }} | |
| owner: HDRUK | |
| repositories: | | |
| ${{ github.event.repository.name }} | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Checkout api | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: HDRUK/gateway-api | |
| path: gateway-api | |
| token: ${{ steps.generate-deployment-token.outputs.token }} | |
| ref: ${{ github.event.inputs.api_branch || 'dev' }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| - name: Cache Composer deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: gateway-api/vendor | |
| key: e2e-composer-${{ hashFiles('gateway-api/composer.lock') }} | |
| restore-keys: e2e-composer- | |
| - name: Install Composer deps | |
| run: | | |
| cd gateway-api | |
| composer install --no-interaction --prefer-dist | |
| - name: Configure Laravel .env + run migrations/seed | |
| run: | | |
| cd gateway-api | |
| cp .env.example .env | |
| sed -i 's/DB_HOST=.*/DB_HOST=127.0.0.1/' .env | |
| sed -i 's/DB_PASSWORD=.*/DB_PASSWORD=root/' .env | |
| php artisan key:generate | |
| php artisan migrate --force | |
| php artisan db:seed --force | |
| php artisan db:seed --class=TestDevUsersSeeder | |
| - name: Start Laravel API and wait for readiness | |
| run: | | |
| cd gateway-api | |
| php artisan serve --host=0.0.0.0 --port=8000 > laravel.log 2>&1 & | |
| echo "Waiting for Laravel to start..." | |
| for i in {1..20}; do | |
| if curl -s http://127.0.0.1:8000 >/dev/null; then | |
| echo "✅ Laravel is up and running!" | |
| break | |
| fi | |
| echo "Waiting for Laravel... attempt $i" | |
| sleep 3 | |
| done | |
| tail -n 20 laravel.log | |
| php artisan queue:work --daemon > queue.log 2>&1 & | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Cache Node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.npm | |
| key: e2e-node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| e2e-node-modules-${{ runner.os }}- | |
| - name: Install Node deps | |
| run: npm install | |
| - name: Build Next.js | |
| run: npm run build | |
| - name: Start Next.js | |
| run: | | |
| nohup npm start > next.log 2>&1 & | |
| sleep 10 | |
| - name: Cache Cypress | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/Cypress | |
| key: e2e-cypress-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| e2e-cypress-${{ runner.os }}- | |
| - name: Run Cypress Tests | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| browser: chrome | |
| headless: true | |
| # - name: Upload Cypress video | |
| # uses: actions/upload-artifact@v4 | |
| # if: always() | |
| # with: | |
| # name: cypress-video | |
| # path: cypress/videos |