|
| 1 | +name: E2E Test for ModernJS SSR |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + e2e-modern: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - name: Checkout Repository |
| 11 | + uses: actions/checkout@v3 |
| 12 | + with: |
| 13 | + fetch-depth: 0 |
| 14 | + |
| 15 | + - name: Install Pnpm |
| 16 | + run: corepack enable |
| 17 | + |
| 18 | + - name: Setup Node.js 18 |
| 19 | + uses: actions/setup-node@v3 |
| 20 | + with: |
| 21 | + node-version: '18' |
| 22 | + cache: 'pnpm' |
| 23 | + |
| 24 | + - name: Set Nx SHA |
| 25 | + uses: nrwl/nx-set-shas@v3 |
| 26 | + |
| 27 | + - name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable |
| 28 | + run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV |
| 29 | + |
| 30 | + - name: Install Dependencies |
| 31 | + run: pnpm install |
| 32 | + |
| 33 | + - name: Install Cypress |
| 34 | + run: npx cypress install |
| 35 | + |
| 36 | + - name: Run Build for All |
| 37 | + run: npx nx run-many --targets=build --projects=tag:type:pkg |
| 38 | + |
| 39 | + - name: Run condition check script |
| 40 | + id: check-ci |
| 41 | + run: node tools/scripts/ci-is-affected.mjs --appName=modernjs |
| 42 | + |
| 43 | + - name: E2E Test for Modern.js SSR |
| 44 | + if: steps.check-ci.outcome == 'success' |
| 45 | + run: | |
| 46 | + lsof -ti tcp:3050,3051,3052,3053,3054,3055,3056 | xargs -r kill && |
| 47 | + pnpm run app:modern:dev & |
| 48 | + sleep 1 && |
| 49 | + npx wait-on http://127.0.0.1:3050/ && |
| 50 | + npx wait-on http://127.0.0.1:3051/ && |
| 51 | + npx wait-on http://127.0.0.1:3052/ && |
| 52 | + npx wait-on http://127.0.0.1:3053/ && |
| 53 | + npx wait-on http://127.0.0.1:3054/ && |
| 54 | + npx wait-on http://127.0.0.1:3055/ && |
| 55 | + npx wait-on http://127.0.0.1:3056/ && |
| 56 | + npx nx run modernjs-ssr-host:e2e && |
| 57 | + lsof -ti tcp:3050,3051,3052,3053,3054,3055,3056 | xargs kill |
0 commit comments