WIP: Tests-set-up #41
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: Run pnpm tests with Redis | |
on: | |
push: | |
branches: | |
- 'testnet' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'testnet' | |
jobs: | |
test: | |
name: Run pnpm tests inside Docker with Redis | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
attempt: [1, 2, 3] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Start Redis container | |
run: | | |
docker run -d --name redis-test-container -p 6379:6379 redis:latest | |
- name: Build Relayer Docker image | |
run: docker build -t relayer-test-image -f deployments/ci/Dockerfile.tests . | |
- name: Run tests inside Docker container | |
run: | | |
docker run --rm --network="host" \ | |
-e REDIS_HOST=127.0.0.1 \ | |
-e REDIS_PORT=6379 \ | |
relayer-test-image | |
- name: Check Test Results | |
if: ${{ failure() && matrix.attempt != '3' }} | |
run: exit 1 | |
- name: Stop and remove Redis container | |
if: always() | |
run: | | |
docker stop redis-test-container | |
docker rm redis-test-container |