Skip to content

Commit

Permalink
Update push.yml (#2900)
Browse files Browse the repository at this point in the history
* Update push.yml

* Update push.yml
  • Loading branch information
VanshikaSabharwal authored Jan 25, 2025
1 parent 3899126 commit 7671150
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
# Create .env file for Talawa API testing environment
- name: Create .env file for Talawa API testing environment
run: cp ./envFiles/.env.ci ./.env

# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
# Build Talawa API compose testing environment
- name: Build Talawa API compose testing environment
run: docker compose build

# Install dependencies and run tests
- name: Run Tests and Upload Coverage to Codecov
# Run tests
- name: Run tests
run: docker compose up --exit-code-from api

# Copy coverage from container
- name: Copy coverage from container
run: |
pnpm install --frozen-lockfile
pnpm run test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
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
Expand All @@ -37,3 +39,10 @@ jobs:
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

0 comments on commit 7671150

Please sign in to comment.