diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 51e54f62e853..712fe9b8fcb8 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -34,7 +34,9 @@ jobs: outputs: TEST_CHUNKS: ${{ steps.test_projects.outputs.CHUNKS }} + E2E_CI_CHUNKS: ${{ steps.e2e_ci_projects.outputs.CHUNKS }} E2E_CHUNKS: ${{ steps.e2e_projects.outputs.CHUNKS }} + E2E_CI_BUILD_ID: ${{ steps.e2e_ci_projects.outputs.BUILD_ID }} E2E_BUILD_ID: ${{ steps.e2e_projects.outputs.BUILD_ID }} LINT_CHUNKS: ${{ steps.lint_projects.outputs.CHUNKS }} BUILD_CHUNKS: ${{ steps.build_projects.outputs.CHUNKS }} @@ -141,13 +143,25 @@ jobs: echo "CHUNKS={\"projects\":$CHUNKS}" >> "$GITHUB_OUTPUT" fi + - name: Prepare e2e-ci targets + id: e2e_ci_projects + env: + CHUNK_SIZE: 1 + run: | + set -euo pipefail + CHUNKS="$(./scripts/ci/generate-chunks.sh e2e-ci)" + if [[ "$CHUNKS" != "[]" ]]; then + echo "CHUNKS={\"projects\":$CHUNKS}" >> "$GITHUB_OUTPUT" + fi + echo BUILD_ID="$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER-$(uuidgen)" >> "$GITHUB_OUTPUT" + - name: Prepare e2e targets id: e2e_projects env: CHUNK_SIZE: 1 run: | set -euo pipefail - CHUNKS="$(./scripts/ci/generate-chunks.sh e2e-ci)" + CHUNKS="$(./scripts/ci/generate-chunks.sh e2e)" if [[ "$CHUNKS" != "[]" ]]; then echo "CHUNKS={\"projects\":$CHUNKS}" >> "$GITHUB_OUTPUT" fi @@ -213,10 +227,10 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} docker-registry: 821090935708.dkr.ecr.eu-west-1.amazonaws.com/ - e2e: + e2e-ci: needs: - prepare - if: needs.prepare.outputs.E2E_CHUNKS + if: needs.prepare.outputs.E2E_CI_CHUNKS runs-on: ec2-runners container: image: public.ecr.aws/m3u4c4h9/island-is/actions-runner-public:latest @@ -227,10 +241,10 @@ jobs: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} API_MOCKS: 'true' NODE_OPTIONS: --max-old-space-size=4096 - E2E_BUILD_ID: '${{ needs.prepare.outputs.E2E_BUILD_ID }}-${{ github.run_attempt }}' + E2E_CI_BUILD_ID: '${{ needs.prepare.outputs.E2E_CI_BUILD_ID }}-${{ github.run_attempt }}' strategy: fail-fast: false - matrix: ${{ fromJson(needs.prepare.outputs.E2E_CHUNKS) }} + matrix: ${{ fromJson(needs.prepare.outputs.E2E_CI_CHUNKS) }} steps: - uses: actions/checkout@v4 @@ -252,6 +266,42 @@ jobs: - name: Running e2e tests run: ./scripts/ci/40_e2e.sh "${AFFECTED_PROJECT}" + e2e: + needs: + - prepare + if: needs.prepare.outputs.E2E_CHUNKS + runs-on: ec2-runners + container: + image: public.ecr.aws/m3u4c4h9/island-is/actions-runner-public:latest + timeout-minutes: 35 + env: + AFFECTED_PROJECT: ${{ matrix.projects }} + NODE_OPTIONS: --max-old-space-size=4096 + E2E_BUILD_ID: '${{ needs.prepare.outputs.E2E_BUILD_ID }}-${{ github.run_attempt }}' + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.prepare.outputs.E2E_CHUNKS) }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: 'package.json' + + - name: Setup yarn + run: corepack enable + + - name: Get cache + id: get-cache + uses: ./.github/actions/get-cache + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + keys: ${{ needs.prepare.outputs.CACHE_KEYS }} + enable-cache: 'node_modules,generated-files' + + - name: Running e2e tests + run: yarn e2e "${AFFECTED_PROJECT}" + linting-workspace: needs: - prepare @@ -410,6 +460,7 @@ jobs: - linting - run-shellcheck - formatting + - e2e-ci - e2e - build steps: @@ -417,6 +468,8 @@ jobs: run: '[[ ${{ needs.prepare.result }} == "success" ]] || exit 1' - name: Check tests success run: '[[ ${{ needs.tests.result }} != "failure" ]] || exit 1' + - name: Check e2e-ci success + run: '[[ ${{ needs.e2e-ci.result }} != "failure" ]] || exit 1' - name: Check e2e success run: '[[ ${{ needs.e2e.result }} != "failure" ]] || exit 1' - name: Check linting success diff --git a/apps/web/server.ts b/apps/web/server.ts index 6c816d3400d6..80bb8d187ca9 100644 --- a/apps/web/server.ts +++ b/apps/web/server.ts @@ -2,6 +2,7 @@ import { bootstrap } from '@island.is/infra-next-server' import proxyConfig from './proxy.config.json' +// test bootstrap({ name: 'web', appDir: 'apps/web',