|
| 1 | +--- |
| 2 | +# yamllint disable rule:line-length |
1 | 3 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
2 | 4 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
3 | 5 |
|
|
20 | 22 | run: |
|
21 | 23 | make lint
|
22 | 24 |
|
| 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 |
23 | 50 |
|
24 | 51 | codecov-startup:
|
25 | 52 | runs-on: ubuntu-latest
|
@@ -54,34 +81,34 @@ jobs:
|
54 | 81 | - python-version: "3.10"
|
55 | 82 | - python-version: "3.9"
|
56 | 83 | 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 |
85 | 112 |
|
86 | 113 | static-analysis:
|
87 | 114 | runs-on: ubuntu-latest
|
|
0 commit comments