Skip to content

Commit

Permalink
Merge branch 'main' into codecov-entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu-codecov authored Jan 15, 2025
2 parents 558e17f + a031977 commit adc7be3
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 31 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_for_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ jobs:
python setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64
python setup.py bdist_wheel --plat-name=macosx-12.6-universal2
python setup.py bdist_wheel --plat-name=win_amd64
- name: Move src file to match PEP625
run: |
cd dist
newfilename=$(ls | grep *.tar.gz | sed 's/codecov-cli/codecov_cli/')
ls | grep *.tar.gz | xargs -I x mv -- x "$newfilename"
ls | grep *.tar.gz | xargs -I x mv -- x "$(ls | grep *.tar.gz | sed 's/codecov-cli/codecov_cli/')"
ls -al
cd ..
- name: Publish package to PyPi
Expand Down
83 changes: 55 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# yamllint disable rule:line-length
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

Expand All @@ -20,6 +22,31 @@ jobs:
run: |
make lint
detect-command-change:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -e .
- name: Run command_dump
run: |
python command_dump.py
- name: Detect changes
run: |
if [ -n "$(git diff codecovcli_commands)" ]; then
echo "Please run `python command_dump.py` before submitting, or install the hooks"
echo "$(git diff codecovcli_commands)"
exit 1
fi
codecov-startup:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,34 +81,34 @@ jobs:
- python-version: "3.10"
- python-version: "3.9"
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 2
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: "${{matrix.python-version}}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -e .
pip install -r tests/requirements.txt
- name: Test with pytest
run: |
pytest --cov --junitxml=${{matrix.python-version}}junit.xml
- name: Dogfooding codecov-cli
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
- name: Upload artifacts for test-results-processing
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{matrix.python-version}}junit.xml
path: ${{matrix.python-version}}junit.xml
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 2
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: "${{matrix.python-version}}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -e .
pip install -r tests/requirements.txt
- name: Test with pytest
run: |
pytest --cov --junitxml=${{matrix.python-version}}junit.xml
- name: Dogfooding codecov-cli
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
- name: Upload artifacts for test-results-processing
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{matrix.python-version}}junit.xml
path: ${{matrix.python-version}}junit.xml

static-analysis:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit adc7be3

Please sign in to comment.