-
Notifications
You must be signed in to change notification settings - Fork 213
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
Codecov is using default branch for coverage and tests reports with workflows on feature branch push event #1732
Comments
@qiuxiaomu can you give more details here? A link to the CI or the output from the Codecov step? |
Sure thing @thomasrockhu-codecov; it is however a private project, so the CI link might not be accessible; but here's the verbose log from codecov, and thanks for taking the time to look into this!
Here's the name: Demo Unit Tests
on:
workflow_run:
workflows: [Demo Build]
types:
- completed
jobs:
unit-test:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 2
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up ta-lib
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
sudo ./configure --prefix=/usr
sudo make
sudo make install
cd -
- name: Set up Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Test with pytest
run: poetry run pytest --cov --cov-report=xml --junitxml=unit_test_report.xml tests -o junit_family=legacy
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
flags: py312
name: demo-py312 here's the build workflow: name: Demo Build
on:
push:
branches: ["*"]
pull_request:
branches: ["develop"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up ta-lib
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
sudo ./configure --prefix=/usr
sudo make
sudo make install
cd -
- name: Set up Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Build with Poetry
run: |
poetry build
rm -rf dist
- name: Lint with Ruff
uses: astral-sh/ruff-action@v2
with:
args: 'check --select E9 --select F63 --select F7 --select F82' |
It seems that Codecov did pick up the changes made on the commit parent as the coverage percentage got updated along with test reports; it's just the branch was still showing |
I have 2 separate workflow files, one for build and the other one is for tests; once the build on commit parent finished successfully the test workflow will be triggered on the commit parent ( in this case it is a feature branch push).
Checking the checkout step I can confirm github runner pulled the correct feature branch. In the Codecov step though, with verbose turned on I can see the branch was
develop
.What is the configuration that I need to let Codecov pick up the commit parent (feature branch) here?
The text was updated successfully, but these errors were encountered: