Skip to content

Commit

Permalink
Change pipeline settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hazal-karakus committed Jan 10, 2025
1 parent b5fb98d commit a523173
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/run_codecov_on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
name: codecov.yml
# Run Codecov on PR open or change
on: pull_request
on:
push:
branches:
- main
pull_request:

jobs:
codecov:
runs-on: ubuntu-20.04

steps:
- name: Check out this repository code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
path: empower
fetch-depth: 0

- name: Install Node
if: github.event_name == 'pull_request'
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Run React tests
# Need to run "npm run build" command for bundle analysis: https://docs.codecov.com/docs/webpack-quick-start
- name: Build React and run tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
Expand All @@ -30,19 +37,21 @@ jobs:
flags: frontend

- name: Run Python Tests
if: github.event_name == 'pull_request'
run: |
pip install -U pytest
pip install pytz
pip install pytest-codecov
pytest --cov=. --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
working-directory: ./empower/flask/src
- name: Upload coverage results to Codecov
if: github.event_name == 'pull_request'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: api
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
if: ${{ !cancelled() && github.event_name == 'pull_request'}}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit a523173

Please sign in to comment.