|
2 | 2 | # For more information see: https://github.com/codacy/codacy-coverage-reporter-action |
3 | 3 | name: PyLops-coverage |
4 | 4 |
|
5 | | -on: [push, pull_request_target] |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: [dev] |
6 | 9 |
|
7 | 10 | jobs: |
8 | 11 | build: |
9 | | - strategy: |
10 | | - matrix: |
11 | | - platform: [ ubuntu-latest, ] |
12 | | - python-version: ["3.11", ] |
13 | | - |
14 | | - runs-on: ${{ matrix.platform }} |
| 12 | + runs-on: ubuntu-latest |
15 | 13 | steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - - name: Get history and tags for SCM versioning to work |
18 | | - run: | |
19 | | - git fetch --prune --unshallow |
20 | | - git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
21 | | - - name: Set up Python ${{ matrix.python-version }} |
22 | | - uses: actions/setup-python@v5 |
23 | | - with: |
24 | | - python-version: ${{ matrix.python-version }} |
25 | | - - name: Install dependencies |
26 | | - run: | |
27 | | - python -m pip install --upgrade pip |
28 | | - pip install flake8 pytest |
29 | | - pip install -r requirements-dev.txt |
30 | | - pip install -r requirements-pyfftw.txt |
31 | | - pip install -r requirements-torch.txt |
32 | | - - name: Install pylops |
33 | | - run: | |
34 | | - pip install . |
35 | | - pip install coverage |
36 | | - - name: Code coverage with coverage |
37 | | - run: | |
38 | | - coverage run -m pytest |
39 | | - coverage xml |
40 | | - - name: Run codacy-coverage-reporter |
41 | | - uses: codacy/codacy-coverage-reporter-action@v1 |
42 | | - with: |
43 | | - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} |
44 | | - coverage-reports: coverage.xml |
| 14 | + - name: Check out source repository |
| 15 | + uses: actions/checkout@v6 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + - name: Install uv with Python |
| 19 | + uses: astral-sh/setup-uv@v6 |
| 20 | + with: |
| 21 | + python-version: "3.11" |
| 22 | + - name: Install dependencies and pylops |
| 23 | + run: uv sync --locked --extra advanced --extra stat --extra deep --all-groups |
| 24 | + - name: Coverage with pytest |
| 25 | + run: | |
| 26 | + uv run coverage run -m pytest |
| 27 | + uv run coverage xml |
| 28 | + uv run coverage html |
| 29 | + - name: Upload HTML coverage report |
| 30 | + uses: actions/upload-artifact@v4 |
| 31 | + with: |
| 32 | + name: coverage-html |
| 33 | + path: htmlcov/ |
| 34 | + - name: Run codacy-coverage-reporter |
| 35 | + if: github.event_name == 'push' |
| 36 | + uses: codacy/codacy-coverage-reporter-action@v1 |
| 37 | + with: |
| 38 | + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} |
| 39 | + coverage-reports: coverage.xml |
0 commit comments