Update postgres Docker tag to v17 #249
Workflow file for this run
This file contains 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: Playwright Tests | |
on: | |
push: | |
branches: [ main, dev ] | |
paths: | |
- "Dockerfile" | |
- "docker-compose.yml" | |
- "go.mod" | |
- "go.sum" | |
- "probe.js" | |
- "src/*" | |
- "*.go" | |
- "e2e/**" | |
- ".github/workflows/playwright.yml" | |
- "docker-compose.prod.yml" | |
pull_request: | |
branches: [ main, dev ] | |
paths: | |
- "Dockerfile" | |
- "docker-compose.yml" | |
- "go.mod" | |
- "go.sum" | |
- "probe.js" | |
- "src/*" | |
- "*.go" | |
- "e2e/**" | |
- ".github/workflows/playwright.yml" | |
- "docker-compose.prod.yml" | |
jobs: | |
e2e-tests: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Create .env | |
run: cp .env.copy .env | |
working-directory: ./ | |
- name: Test the Docker image | |
run: docker compose -f docker-compose.prod.yml --env-file .env up -d | |
working-directory: ./ | |
- name: Change directory and install dependencies | |
run: npm ci | |
working-directory: e2e | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
working-directory: e2e | |
- name: Get Password from Docker logs | |
run: | | |
echo "TEMP_E2E_PLAYWRIGHT_PASSWORD=$(docker logs xsshunter-go-xsshunter-go-1 | grep -oP 'PASSWORD: \K.*')" > e2e/.env | |
- name: Run Playwright tests | |
run: npx playwright test | |
working-directory: e2e | |
- name: Stop the xsshunter-go Docker container | |
run: docker compose -f docker-compose.prod.yml down xsshunter-go | |
working-directory: ./ | |
- name: Add DATABASE_URL to env | |
run: echo -e "\nDATABASE_URL=postgres://xsshunter:xsshunter@xsshunter-postgres:5432/xsshunter?sslmode=disable" >> .env | |
working-directory: ./ | |
- name: Start the xsshunter-go Docker container | |
run: docker compose -f docker-compose.prod.yml --env-file .env up -d | |
working-directory: ./ | |
- name: Wait for the xsshunter-go Docker container to start | |
run: sleep 10 | |
working-directory: ./ | |
- name: Get Password from Docker logs for postgres test | |
run: | | |
echo "TEMP_E2E_PLAYWRIGHT_PASSWORD=$(docker logs xsshunter-go-xsshunter-go-1 | grep -oP 'PASSWORD: \K.*')" > e2e/.env | |
- name: Run Playwright tests with the database | |
run: npx playwright test | |
working-directory: e2e |