Skip to content

Commit adc7be3

Browse files
Merge branch 'main' into codecov-entrypoint
2 parents 558e17f + a031977 commit adc7be3

File tree

7 files changed

+503
-31
lines changed

7 files changed

+503
-31
lines changed

.github/workflows/build_for_pypi.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ jobs:
3333
python setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64
3434
python setup.py bdist_wheel --plat-name=macosx-12.6-universal2
3535
python setup.py bdist_wheel --plat-name=win_amd64
36+
- name: Move src file to match PEP625
37+
run: |
3638
cd dist
37-
newfilename=$(ls | grep *.tar.gz | sed 's/codecov-cli/codecov_cli/')
38-
ls | grep *.tar.gz | xargs -I x mv -- x "$newfilename"
39+
ls | grep *.tar.gz | xargs -I x mv -- x "$(ls | grep *.tar.gz | sed 's/codecov-cli/codecov_cli/')"
3940
ls -al
4041
cd ..
4142
- name: Publish package to PyPi

.github/workflows/ci.yml

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
# yamllint disable rule:line-length
13
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
24
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
35

@@ -20,6 +22,31 @@ jobs:
2022
run: |
2123
make lint
2224
25+
detect-command-change:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
submodules: true
31+
- name: Set up Python 3.11
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.11"
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -r requirements.txt
39+
python -m pip install -e .
40+
- name: Run command_dump
41+
run: |
42+
python command_dump.py
43+
- name: Detect changes
44+
run: |
45+
if [ -n "$(git diff codecovcli_commands)" ]; then
46+
echo "Please run `python command_dump.py` before submitting, or install the hooks"
47+
echo "$(git diff codecovcli_commands)"
48+
exit 1
49+
fi
2350
2451
codecov-startup:
2552
runs-on: ubuntu-latest
@@ -54,34 +81,34 @@ jobs:
5481
- python-version: "3.10"
5582
- python-version: "3.9"
5683
steps:
57-
- uses: actions/checkout@v4
58-
with:
59-
submodules: true
60-
fetch-depth: 2
61-
- name: Set up Python ${{matrix.python-version}}
62-
uses: actions/setup-python@v5
63-
with:
64-
python-version: "${{matrix.python-version}}"
65-
- name: Install dependencies
66-
run: |
67-
python -m pip install --upgrade pip
68-
pip install -r requirements.txt
69-
python -m pip install -e .
70-
pip install -r tests/requirements.txt
71-
- name: Test with pytest
72-
run: |
73-
pytest --cov --junitxml=${{matrix.python-version}}junit.xml
74-
- name: Dogfooding codecov-cli
75-
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
76-
run: |
77-
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
78-
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
79-
- name: Upload artifacts for test-results-processing
80-
if: ${{ !cancelled() }}
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: ${{matrix.python-version}}junit.xml
84-
path: ${{matrix.python-version}}junit.xml
84+
- uses: actions/checkout@v4
85+
with:
86+
submodules: true
87+
fetch-depth: 2
88+
- name: Set up Python ${{matrix.python-version}}
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: "${{matrix.python-version}}"
92+
- name: Install dependencies
93+
run: |
94+
python -m pip install --upgrade pip
95+
pip install -r requirements.txt
96+
python -m pip install -e .
97+
pip install -r tests/requirements.txt
98+
- name: Test with pytest
99+
run: |
100+
pytest --cov --junitxml=${{matrix.python-version}}junit.xml
101+
- name: Dogfooding codecov-cli
102+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
103+
run: |
104+
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
105+
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
106+
- name: Upload artifacts for test-results-processing
107+
if: ${{ !cancelled() }}
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: ${{matrix.python-version}}junit.xml
111+
path: ${{matrix.python-version}}junit.xml
85112

86113
static-analysis:
87114
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)