|
| 1 | +name: test |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + |
| 9 | +jobs: |
| 10 | + pre-commit: |
| 11 | + runs-on: ubuntu-22.04 |
| 12 | + steps: |
| 13 | + - name: Clone and checkout branch |
| 14 | + uses: actions/checkout@v4 |
| 15 | + - name: Setup Python |
| 16 | + uses: actions/setup-python@v5 |
| 17 | + with: |
| 18 | + python-version: "3.12" |
| 19 | + cache: "pip" |
| 20 | + - name: Run pre-commit hooks |
| 21 | + uses: pre-commit/action@v3.0.1 |
| 22 | + |
| 23 | + build: |
| 24 | + needs: pre-commit |
| 25 | + runs-on: ubuntu-22.04 |
| 26 | + steps: |
| 27 | + - name: Clone full tree, and checkout branch |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + - name: Setup Python and PDM |
| 32 | + uses: pdm-project/setup-pdm@v4 |
| 33 | + with: |
| 34 | + python-version: "3.12" |
| 35 | + version: "2.16.1" |
| 36 | + - name: Build source dist and wheels |
| 37 | + run: pdm build --verbose |
| 38 | + - name: Upload source dist and wheels to artifacts |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: dist |
| 42 | + path: dist/ |
| 43 | + retention-days: 5 |
| 44 | + if-no-files-found: error |
| 45 | + |
| 46 | + # test: |
| 47 | + # needs: pre-commit |
| 48 | + # permissions: |
| 49 | + # checks: write |
| 50 | + # strategy: |
| 51 | + # fail-fast: false |
| 52 | + # matrix: |
| 53 | + # operating_system: |
| 54 | + # - ubuntu-22.04 |
| 55 | + # - windows-2022 |
| 56 | + # python_version: |
| 57 | + # - "3.8" |
| 58 | + # - "3.9" |
| 59 | + # - "3.10" |
| 60 | + # - "3.11" |
| 61 | + # - "3.12" |
| 62 | + # runs-on: ${{ matrix.operating_system }} |
| 63 | + # steps: |
| 64 | + # - name: Clone full tree, and checkout branch |
| 65 | + # uses: actions/checkout@v4 |
| 66 | + # with: |
| 67 | + # fetch-depth: 0 |
| 68 | + # - name: Setup Python and PDM |
| 69 | + # uses: pdm-project/setup-pdm@v4 |
| 70 | + # with: |
| 71 | + # python-version: ${{ matrix.python_version }} |
| 72 | + # version: "2.16.1" |
| 73 | + # - name: Create virtual environment |
| 74 | + # run: pdm install |
| 75 | + # - name: Run tests |
| 76 | + # run: pdm run test |
| 77 | + # - name: Publish test results |
| 78 | + # uses: mikepenz/action-junit-report@v4 |
| 79 | + # # Always run, even if the tests fail. |
| 80 | + # if: success() || failure() |
| 81 | + # with: |
| 82 | + # report_paths: rspec.xml |
| 83 | + # - name: Upload coverage report to artifacts |
| 84 | + # uses: actions/upload-artifact@v4 |
| 85 | + # # Always run, even if the tests fail. |
| 86 | + # if: success() || failure() |
| 87 | + # with: |
| 88 | + # name: coverage-${{ matrix.operating_system}}-${{ matrix.python_version }} |
| 89 | + # path: coverage.xml |
| 90 | + # retention-days: 5 |
| 91 | + # if-no-files-found: warn |
| 92 | + |
| 93 | + # coverage: |
| 94 | + # needs: test |
| 95 | + # # Always run, even if the test job failed. |
| 96 | + # if: success() || failure() |
| 97 | + # runs-on: ubuntu-22.04 |
| 98 | + # steps: |
| 99 | + # - name: Download coverage reports from artifacts |
| 100 | + # uses: actions/download-artifact@v4 |
| 101 | + # with: |
| 102 | + # pattern: coverage-* |
| 103 | + # merge-multiple: false |
| 104 | + # - name: Generate code coverage summary report |
| 105 | + # uses: irongut/CodeCoverageSummary@v1.3.0 |
| 106 | + # with: |
| 107 | + # filename: coverage-*/coverage.xml |
| 108 | + # format: markdown |
| 109 | + # hide_branch_rate: false |
| 110 | + # hide_complexity: false |
| 111 | + # indicators: false |
| 112 | + # output: both |
| 113 | + # - name: Write to job summary |
| 114 | + # run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY |
0 commit comments