Skip to content

Commit

Permalink
test: github action run for integration api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Nov 28, 2023
1 parent 7fe2e5a commit a0a0e82
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/integration-tests-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Run API integration tests
on: pull_request

jobs:
runTests:
name: Run API integration tests
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
defaults:
run:
working-directory: ./packages/integration-tests
strategy:
matrix:
node-version: ['lts/*']
test-pattern:
- addresses.test.ts
- batches.test.ts
- blocks.test.ts
- contracts.test.ts
- logs.test.ts
- stats.test.ts
- tokens.test.ts
- transactions.test.ts
steps:
- name: Checkout with Submodule
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.ZKSYNC_ADMIN_BOT_ORG_REPO_WRITE }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: |
npm ci
npx playwright install --with-deps chromium
# - name: Spin up the BE frontend
# run: |
# npm run --prefix repos/zksync-dapp-scan-v2 dev &

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

- name: Start docker containers
run: |
docker-compose -f "../../docker-compose.yaml" up -d --build
- name: List running containers
run: docker ps

- name: API tests run (parallel)
run: npx jest --verbose --testPathPattern=${{ matrix.test-pattern }}

- name: Stop containers
if: always()
run: docker-compose -f "../../docker-compose.yaml" down

0 comments on commit a0a0e82

Please sign in to comment.