Update testing.md #2339
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: Push Workflow for develop-postgres | |
on: | |
push: | |
branches: | |
- develop-postgres | |
jobs: | |
test-and-upload-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Create .env file for Talawa API testing environment | |
- name: Create .env file for Talawa API testing environment | |
run: cp ./envFiles/.env.ci ./.env | |
# Build Talawa API compose testing environment | |
- name: Build Talawa API compose testing environment | |
run: docker compose build | |
# Run tests | |
- name: Run tests | |
run: docker compose up --exit-code-from api | |
# Copy coverage from container | |
- name: Copy coverage from container | |
run: | | |
CONTAINER_ID=$(docker ps -aq --filter "ancestor=talawa-api") | |
docker cp $CONTAINER_ID:/home/talawa/api/coverage ./coverage | |
# Upload coverage to Codecov | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
files: ./coverage/lcov.info | |
# Test acceptable level of code coverage | |
- name: Test acceptable level of code coverage | |
uses: VeryGoodOpenSource/very_good_coverage@v2 | |
with: | |
path: "./coverage/lcov.info" | |
min_coverage: 39.0 |