e2e #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: e2e | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| secrets: | |
| E2E_HOST: | |
| required: true | |
| E2E_TOKEN: | |
| required: true | |
| E2E_SERVER_ROLE_TOKEN: | |
| required: true | |
| NPM_TOKEN: | |
| required: true | |
| env: | |
| NODE_VERSION: 20 | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| jobs: | |
| e2e: | |
| name: e2e test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Set yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| id: yarn-cache | |
| with: | |
| path: | | |
| **/node_modules | |
| **/.eslintcache | |
| ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Build | |
| run: yarn build | |
| - name: Create .env file | |
| run: | | |
| echo "API_KEY=${{ secrets.E2E_TOKEN }}" > .env | |
| echo "SERVER_ROLE_API_KEY=${{ secrets.E2E_SERVER_ROLE_TOKEN }}" >> .env | |
| echo "ENDPOINT=${{ secrets.E2E_HOST }}" >> .env | |
| - name: Run e2e tests | |
| run: yarn test:e2e |