|
1 | | -name: Build and test Python package |
| 1 | +name: Check and test Python project |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ main ] |
| 5 | + branches: |
| 6 | + - main |
6 | 7 | pull_request: |
7 | | - branches: [ main ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - linting: |
11 | | - name: Linting |
12 | | - runs-on: 'ubuntu-latest' |
| 10 | + lint-and-test: |
13 | 11 | strategy: |
14 | | - matrix: |
15 | | - python-version: |
| 12 | + matrix: |
| 13 | + python-version: |
16 | 14 | - "3.7" |
17 | 15 | - "3.8" |
18 | 16 | - "3.9" |
19 | 17 | - "3.10" |
20 | 18 | - "3.11" |
21 | | - steps: |
22 | | - - uses: actions/checkout@v3 |
23 | | - - name: Set up Python ${{ matrix.python-version }} |
24 | | - uses: greenbone/actions/lint-python@v2 |
25 | | - with: |
26 | | - packages: autohooks tests |
27 | | - python-version: ${{ matrix.python-version }} |
28 | | - type-checking: |
29 | | - name: Type-checker |
30 | | - runs-on: 'ubuntu-latest' |
31 | | - strategy: |
32 | | - matrix: |
33 | | - python-version: |
34 | | - - "3.7" |
35 | | - - "3.8" |
36 | | - - "3.9" |
37 | | - - "3.10" |
38 | | - - "3.11" |
39 | | - steps: |
40 | | - - uses: actions/checkout@v3 |
41 | | - - name: Set up Python ${{ matrix.python-version }} |
42 | | - uses: greenbone/actions/mypy-python@v2 |
43 | | - with: |
44 | | - packages: autohooks |
45 | | - python-version: ${{ matrix.python-version }} |
46 | | - test: |
47 | | - name: Run all tests |
48 | | - runs-on: 'ubuntu-latest' |
49 | | - strategy: |
50 | | - matrix: |
51 | | - python-version: |
52 | | - - "3.7" |
53 | | - - "3.8" |
54 | | - - "3.9" |
55 | | - - "3.10" |
56 | | - - "3.11" |
57 | | - steps: |
58 | | - - uses: actions/checkout@v3 |
59 | | - - name: Install poetry and dependencies |
60 | | - uses: greenbone/actions/poetry@v2 |
61 | | - with: |
62 | | - python-version: ${{ matrix.python-version }} |
63 | | - - name: Run unit tests |
64 | | - run: poetry run python -m unittest |
| 19 | + |
| 20 | + name: Check and test |
| 21 | + uses: greenbone/workflows/.github/workflows/ci-python.yml@main |
| 22 | + with: |
| 23 | + lint-packages: autohooks tests |
| 24 | + python-version: ${{ matrix.python-version }} |
| 25 | + |
65 | 26 |
|
66 | 27 | codecov: |
67 | 28 | name: Upload coverage to codecov.io |
68 | | - needs: test |
69 | | - runs-on: 'ubuntu-latest' |
| 29 | + # run action directly because GitHub has an internal error when using our |
| 30 | + # generic reusable workflow |
| 31 | + runs-on: "ubuntu-latest" |
70 | 32 | steps: |
71 | 33 | - uses: actions/checkout@v3 |
72 | | - - name: Calculate and upload coverage to codecov.io |
| 34 | + - name: Install and calculate and upload coverage to codecov.io |
73 | 35 | uses: greenbone/actions/coverage-python@v2 |
74 | 36 | with: |
75 | 37 | python-version: "3.10" |
| 38 | + cache: "true" |
| 39 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 40 | + |
| 41 | + versioning: |
| 42 | + name: Check versioning |
| 43 | + uses: greenbone/workflows/.github/workflows/check-version.yml@main |
0 commit comments