feat: add simple e2e tests #10
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: Run e2e tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # ratchet:actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # ratchet:pnpm/action-setup@v6 | |
| with: | |
| package_json_file: ./e2e/package.json | |
| - name: Set up Docker | |
| id: docker | |
| uses: docker/setup-docker-action@6d7cfa65f60a9dda7b46e5513fa982536f3c9877 # ratchet:docker/setup-docker-action@v5 | |
| - name: Get docker socket | |
| id: docker-socket | |
| env: | |
| SOCK: ${{ steps.docker.outputs.sock }} | |
| run: echo "DOCKER_SOCK=${SOCK#unix://}" >> "$GITHUB_ENV" | |
| - name: Spin up docker-compose | |
| run: docker compose -f docker-compose.e2e.yml up --build --force-recreate --remove-orphans -d | |
| working-directory: e2e | |
| - name: Check if the url is accessible | |
| run: sleep 20s && curl -v http://tinyauth.127.0.0.1.sslip.io | |
| # - name: Install dependencies | |
| # run: pnpm ci | |
| # working-directory: e2e | |
| # | |
| # - name: Install Playwright Browsers | |
| # run: pnpm exec playwright install --with-deps | |
| # working-directory: e2e | |
| # - name: Run Playwright tests | |
| # run: pnpm test | |
| # working-directory: e2e | |
| # env: | |
| # DOCKER_SOCKET_PATH: ${{ steps.docker-socket.outputs.DOCKER_SOCK }} | |
| # | |
| # - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4 | |
| # if: ${{ !cancelled() }} | |
| # with: | |
| # name: playwright-report | |
| # path: e2e/playwright-report/ | |
| # retention-days: 5 |