|
| 1 | +name: E2E Treeshake |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + e2e-treeshake: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + permissions: |
| 10 | + contents: read |
| 11 | + actions: read |
| 12 | + timeout-minutes: 30 |
| 13 | + steps: |
| 14 | + - name: Checkout Repository |
| 15 | + uses: actions/checkout@v5 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + |
| 19 | + - name: Cache Tool Downloads |
| 20 | + uses: actions/cache@v5 |
| 21 | + with: |
| 22 | + path: ~/.cache |
| 23 | + key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }} |
| 24 | + restore-keys: | |
| 25 | + ${{ runner.os }}-toolcache- |
| 26 | +
|
| 27 | + - name: Set Playwright cache status |
| 28 | + run: | |
| 29 | + if [ -d "$HOME/.cache/ms-playwright" ] || [ -d "$HOME/.cache/Cypress" ]; then |
| 30 | + echo "PLAYWRIGHT_CACHE_HIT=true" >> "$GITHUB_ENV" |
| 31 | + else |
| 32 | + echo "PLAYWRIGHT_CACHE_HIT=false" >> "$GITHUB_ENV" |
| 33 | + fi |
| 34 | +
|
| 35 | + - name: Setup pnpm |
| 36 | + uses: pnpm/action-setup@v4 |
| 37 | + |
| 38 | + - name: Setup Node.js 20 |
| 39 | + uses: actions/setup-node@v6 |
| 40 | + with: |
| 41 | + node-version: '20' |
| 42 | + cache: 'pnpm' |
| 43 | + cache-dependency-path: '**/pnpm-lock.yaml' |
| 44 | + |
| 45 | + - name: Set Nx SHA |
| 46 | + uses: nrwl/nx-set-shas@v4 |
| 47 | + |
| 48 | + - name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable |
| 49 | + run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> "$GITHUB_ENV" |
| 50 | + |
| 51 | + - name: Install Dependencies |
| 52 | + run: pnpm install --frozen-lockfile |
| 53 | + |
| 54 | + - name: Run Build for All |
| 55 | + run: npx nx run-many --targets=build --projects=tag:type:pkg |
| 56 | + |
| 57 | + - name: Run condition check script |
| 58 | + id: check-ci |
| 59 | + run: node tools/scripts/ci-is-affected.mjs --appName=treeshake-server,treeshake-frontend |
| 60 | + |
| 61 | + - name: E2E Treeshake Server |
| 62 | + if: steps.check-ci.outcome == 'success' |
| 63 | + run: npx nx run treeshake-server:test |
| 64 | + |
| 65 | + - name: E2E Treeshake Frontend |
| 66 | + if: steps.check-ci.outcome == 'success' |
| 67 | + run: npx nx run treeshake-frontend:e2e |
0 commit comments