Integration tests #1
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: integration | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and run Docker Compose | |
run: | | |
docker-compose up -d --build | |
- name: Wait for services to be ready | |
run: | | |
echo "Waiting for services to be ready..." | |
sleep 30 | |
- name: Run integration tests | |
run: | | |
docker-compose run node-app npm test | |
- name: Tear down Docker Compose | |
if: always() | |
run: | | |
docker-compose down |