Skip to content

Update push.yml #2900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading