Skip to content

Commit

Permalink
test: use github services to run db
Browse files Browse the repository at this point in the history
  • Loading branch information
hazardsoft committed Sep 8, 2023
1 parent 77df6a3 commit 6b9f9a9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Build'
description: 'Sets up the repository'
runs:
using: 'composite'
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install dependencies
shell: bash
run: pnpm install
25 changes: 20 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,33 @@ jobs:

e2e-tests:
runs-on: ubuntu-latest
# container: mcr.microsoft.com/playwright:v1.37.0-jammy
container: mcr.microsoft.com/playwright:v1.37.0-jammy
strategy:
fail-fast: false
matrix:
shard: [1/4, 2/4, 3/4, 4/4]
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: quotes
options: >-
--health-cmd pg_isready
--health-interval 1s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build
- uses: ./.github/actions/docker-compose
- uses: ./.github/actions/playwright
# - uses: ./.github/actions/build
- uses: ./.github/actions/install-deps
# - uses: ./.github/actions/docker-compose
# - uses: ./.github/actions/playwright
- name: Run e2e tests
run: pnpm test:e2e --shard=${{ matrix.shard }}
run: npx playwright test --shard=${{ matrix.shard }}
working-directory: e2e
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down

0 comments on commit 6b9f9a9

Please sign in to comment.