|
| 1 | +name: Report intermittent E2E Tests |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '42 04 * * *' |
| 6 | + |
| 7 | +jobs: |
| 8 | + test: |
| 9 | + name: 'Test' |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v3 |
| 13 | + - name: Setup node |
| 14 | + uses: actions/setup-node@v2 |
| 15 | + with: |
| 16 | + node-version: '16.15.1' |
| 17 | + |
| 18 | + - uses: pnpm/action-setup@v2.2.4 |
| 19 | + name: Install pnpm |
| 20 | + id: pnpm-install |
| 21 | + with: |
| 22 | + version: 7.16.0 |
| 23 | + run_install: false |
| 24 | + |
| 25 | + - uses: actions/cache@v3 |
| 26 | + name: Setup pnpm cache |
| 27 | + with: |
| 28 | + path: .pnpm-store/v3 |
| 29 | + key: ${{ runner.os }}-pnpm-test-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 30 | + restore-keys: | |
| 31 | + ${{ runner.os }}-pnpm-test- |
| 32 | +
|
| 33 | + - name: Turbo Cache |
| 34 | + id: turbo-cache |
| 35 | + uses: actions/cache@v3 |
| 36 | + with: |
| 37 | + path: .turbo |
| 38 | + key: turbo-${{ github.job }}-${{ github.sha }} |
| 39 | + restore-keys: | |
| 40 | + turbo-${{ github.job }}- |
| 41 | +
|
| 42 | + - name: Install |
| 43 | + run: pnpm install --no-frozen-lockfile |
| 44 | + |
| 45 | + - name: Build all packages |
| 46 | + run: pnpm build || pnpm build |
| 47 | + |
| 48 | + - name: Test |
| 49 | + run: pnpm run test |
| 50 | + |
| 51 | + cypress-prepare: |
| 52 | + name: 'Cypress prepare' |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v3 |
| 56 | + - name: Setup node |
| 57 | + uses: actions/setup-node@v2 |
| 58 | + with: |
| 59 | + node-version: '16.15.1' |
| 60 | + |
| 61 | + - uses: pnpm/action-setup@v2.2.4 |
| 62 | + name: Install pnpm |
| 63 | + id: pnpm-install |
| 64 | + with: |
| 65 | + version: 7.16.0 |
| 66 | + run_install: false |
| 67 | + |
| 68 | + - uses: actions/cache@v3 |
| 69 | + name: Setup pnpm cache |
| 70 | + with: |
| 71 | + path: | |
| 72 | + .pnpm-store/v3 |
| 73 | + ~/.cache/Cypress |
| 74 | + key: ${{ runner.os }}-pnpm-cypress-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 75 | + restore-keys: | |
| 76 | + ${{ runner.os }}-pnpm-cypress- |
| 77 | +
|
| 78 | + - name: Turbo Cache |
| 79 | + id: turbo-cache |
| 80 | + uses: actions/cache@v3 |
| 81 | + with: |
| 82 | + path: .turbo |
| 83 | + key: turbo-cypress-${{ github.sha }} |
| 84 | + restore-keys: | |
| 85 | + turbo-cypress- |
| 86 | +
|
| 87 | + - name: Install |
| 88 | + run: pnpm install --no-frozen-lockfile |
| 89 | + |
| 90 | + - name: Build |
| 91 | + run: pnpm build || pnpm build |
| 92 | + |
| 93 | + - name: Build e2e |
| 94 | + run: pnpm build:e2e |
| 95 | + |
| 96 | + - id: set-dirs |
| 97 | + run: echo "::set-output name=dirs::$(ls | jq -R -s -c 'split("\n")[:-1]')" |
| 98 | + working-directory: e2e/cypress/e2e |
| 99 | + |
| 100 | + outputs: |
| 101 | + dirs: ${{ steps.set-dirs.outputs.dirs }} |
| 102 | + |
| 103 | + cypress: |
| 104 | + name: 'Cypress' |
| 105 | + # cypress-prepare will install and build everything into cache |
| 106 | + needs: cypress-prepare |
| 107 | + runs-on: ubuntu-latest |
| 108 | + strategy: |
| 109 | + fail-fast: false |
| 110 | + matrix: |
| 111 | + app: ${{ fromJson(needs.cypress-prepare.outputs.dirs) }} |
| 112 | + |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v3 |
| 115 | + - name: Setup node |
| 116 | + uses: actions/setup-node@v2 |
| 117 | + with: |
| 118 | + node-version: '16.15.1' |
| 119 | + |
| 120 | + - uses: pnpm/action-setup@v2.2.4 |
| 121 | + name: Install pnpm |
| 122 | + id: pnpm-install |
| 123 | + with: |
| 124 | + version: 7.16.0 |
| 125 | + run_install: false |
| 126 | + |
| 127 | + - uses: actions/cache@v3 |
| 128 | + name: Setup pnpm cache |
| 129 | + with: |
| 130 | + path: | |
| 131 | + .pnpm-store/v3 |
| 132 | + ~/.cache/Cypress |
| 133 | + key: ${{ runner.os }}-pnpm-cypress-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 134 | + restore-keys: | |
| 135 | + ${{ runner.os }}-pnpm-cypress- |
| 136 | +
|
| 137 | + - name: Turbo Cache |
| 138 | + id: turbo-cache |
| 139 | + uses: actions/cache@v3 |
| 140 | + with: |
| 141 | + path: .turbo |
| 142 | + key: turbo-cypress-${{ github.sha }} |
| 143 | + restore-keys: | |
| 144 | + turbo-cypress- |
| 145 | +
|
| 146 | + - name: Install |
| 147 | + run: pnpm install --no-frozen-lockfile |
| 148 | + |
| 149 | + - name: Cypress |
| 150 | + run: pnpm run e2e run --headed ${{matrix.app}} --stdout prod,dev |
| 151 | + |
| 152 | + - uses: actions/upload-artifact@v2 |
| 153 | + if: failure() |
| 154 | + with: |
| 155 | + name: cypress |
| 156 | + path: | |
| 157 | + e2e/cypress/videos/**/* |
| 158 | + e2e/cypress/screenshots/**/* |
0 commit comments