|
52 | 52 | - name: Run unit test |
53 | 53 | run: yarn test |
54 | 54 |
|
| 55 | + # - name: Run e2e test install |
| 56 | + # run: yarn playwright install --with-deps |
| 57 | + |
| 58 | + # - name: Run e2e test |
| 59 | + # run: yarn playwright test |
| 60 | + |
55 | 61 | deploy-to-vercel: |
56 | 62 | runs-on: ubuntu-latest |
57 | 63 | outputs: |
@@ -104,6 +110,62 @@ jobs: |
104 | 110 | format: "YYYY년 MM월 DD일 HH시 mm분" |
105 | 111 | utcOffset: "+09:00" |
106 | 112 |
|
| 113 | + e2e-test: |
| 114 | + runs-on: ubuntu-latest |
| 115 | + needs: [deploy-to-vercel] |
| 116 | + steps: |
| 117 | + - name: Checkout |
| 118 | + uses: actions/checkout@v4 |
| 119 | + |
| 120 | + - name: Setup node |
| 121 | + uses: actions/setup-node@v4 |
| 122 | + with: |
| 123 | + node-version: 18 |
| 124 | + cache: "yarn" |
| 125 | + |
| 126 | + - name: Set yarn version |
| 127 | + id: set-version |
| 128 | + run: | |
| 129 | + yarn set version 4.1.1 |
| 130 | + echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT |
| 131 | +
|
| 132 | + - name: Yarn cache - PnP |
| 133 | + uses: actions/cache@v4 |
| 134 | + with: |
| 135 | + path: | |
| 136 | + .yarn/cache |
| 137 | + .pnp.* |
| 138 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }} |
| 139 | + restore-keys: | |
| 140 | + ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}- |
| 141 | +
|
| 142 | + - name: Install dependencies |
| 143 | + run: yarn |
| 144 | + |
| 145 | + # - name: Waiting for 200 from the Vercel Preview |
| 146 | + # uses: patrickedqvist/[email protected] |
| 147 | + # id: waitFor200 |
| 148 | + # with: |
| 149 | + # token: ${{ secrets.GITHUB_TOKEN }} |
| 150 | + # max_timeout: 300 |
| 151 | + # check_interval: 10 |
| 152 | + # - name: Make environment file |
| 153 | + # run: | |
| 154 | + # echo "Deployed to: ${{ steps.waitFor200.outputs.url }}" |
| 155 | + # touch .env |
| 156 | + # echo "${{ secrets.ENV_FILE }}" > .env |
| 157 | + # echo TEST_BASE_URL=${{ steps.waitFor200.outputs.url }} >> .env |
| 158 | + # - name: Install dependencies |
| 159 | + # run: npm ci |
| 160 | + |
| 161 | + - name: Install Playwright Browsers |
| 162 | + run: yarn playwright install --with-deps |
| 163 | + |
| 164 | + - name: Run Playwright tests |
| 165 | + run: yarn playwright test |
| 166 | + env: |
| 167 | + PLAYWRIGHT_TEST_BASE_URL: ${{ steps.deploy-to-vercel.outputs.preview_url }} |
| 168 | + |
107 | 169 | github-privew-comment: |
108 | 170 | runs-on: ubuntu-latest |
109 | 171 | needs: [deploy-to-vercel] |
|
0 commit comments