Skip to content

Commit

Permalink
fix: new steps
Browse files Browse the repository at this point in the history
  • Loading branch information
olehbairak committed Jan 23, 2024
1 parent 4c87374 commit 93dca47
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/integration-tests-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@ name: Integration test - API
on: pull_request

jobs:
startDocker:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
steps:
- name: Checkout with Submodule
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Start Docker container
run: |
docker-compose -f "docker-compose.yaml" build
docker-compose -f "docker-compose.yaml" up -d
runTests:
needs: startDocker
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -40,38 +64,18 @@ jobs:
npm ci --no-audit
npx playwright install --with-deps chromium
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker container
run: |
docker-compose -f "docker-compose.yaml" build
- name: Start Docker containers
run: |
docker-compose -f "docker-compose.yaml" up -d
- name: Cache Docker images
uses: actions/cache@v2
with:
path: |
~/.docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/*.lock') }}
restore-keys: |
${{ runner.os }}-docker-
- name: List running containers
- name: List running containers (for debug purposes)
run: docker ps

- name: API tests run (parallel)
- name: API tests run
run: |
cd packages/integration-tests
npx jest --verbose --testPathPattern=${{ matrix.test-pattern }}
stopDocker:
needs: runTests
runs-on: ubuntu-latest
steps:
- name: Stop Docker containers
if: always()
run: |
docker-compose -f "docker-compose.yaml" down

0 comments on commit 93dca47

Please sign in to comment.