|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Build |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Run build action |
| 24 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/poetry-install@main |
| 25 | + with: |
| 26 | + python_version: "3.11" |
| 27 | + |
| 28 | + lint: |
| 29 | + name: Run code linter |
| 30 | + runs-on: ubuntu-22.04 |
| 31 | + needs: build |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout repository |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Run build action |
| 38 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/poetry-install@main |
| 39 | + with: |
| 40 | + python_version: "3.11" |
| 41 | + |
| 42 | + - name: Lint |
| 43 | + run: poetry run $(make lint --just-print --silent) |
| 44 | + |
| 45 | + type-check: |
| 46 | + name: Check static types |
| 47 | + runs-on: ubuntu-22.04 |
| 48 | + needs: build |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout repository |
| 52 | + uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - name: Run build action |
| 55 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/poetry-install@main |
| 56 | + with: |
| 57 | + python_version: "3.11" |
| 58 | + |
| 59 | + - name: Check static types |
| 60 | + run: poetry run $(make type-check --just-print --silent) |
| 61 | + |
| 62 | + safety-check: |
| 63 | + name: Scan packages for vulnerabilities |
| 64 | + runs-on: ubuntu-22.04 |
| 65 | + needs: build |
| 66 | + |
| 67 | + steps: |
| 68 | + - name: Checkout repository |
| 69 | + uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: Run build action |
| 72 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/poetry-install@main |
| 73 | + with: |
| 74 | + python_version: "3.11" |
| 75 | + |
| 76 | + - name: Scan packages for vulnerabilities |
| 77 | + run: poetry run $(make safety-check --just-print --silent) |
| 78 | + |
| 79 | + spelling-check: |
| 80 | + name: Run spelling check |
| 81 | + runs-on: ubuntu-22.04 |
| 82 | + needs: build |
| 83 | + |
| 84 | + steps: |
| 85 | + - name: Checkout repository |
| 86 | + uses: actions/checkout@v4 |
| 87 | + |
| 88 | + - name: Run build action |
| 89 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/poetry-install@main |
| 90 | + with: |
| 91 | + python_version: "3.11" |
| 92 | + |
| 93 | + - name: Run spelling check |
| 94 | + run: poetry run $(make spelling-check --just-print --silent) |
| 95 | + |
| 96 | + test: |
| 97 | + name: Run the tests |
| 98 | + runs-on: ubuntu-22.04 |
| 99 | + needs: build |
| 100 | + |
| 101 | + steps: |
| 102 | + - name: Checkout repository |
| 103 | + uses: actions/checkout@v4 |
| 104 | + |
| 105 | + - name: Run build action |
| 106 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/poetry-install@main |
| 107 | + with: |
| 108 | + python_version: "3.11" |
| 109 | + |
| 110 | + - name: Run the tests |
| 111 | + run: poetry run $(make test --just-print --silent) |
| 112 | + |
| 113 | + - name: Upload coverage report |
| 114 | + uses: actions/upload-artifact@v4 |
| 115 | + with: |
| 116 | + name: coverage |
| 117 | + path: coverage.xml |
| 118 | + |
| 119 | + sonar: |
| 120 | + name: SonarCloud |
| 121 | + runs-on: ubuntu-latest |
| 122 | + needs: test |
| 123 | + steps: |
| 124 | + - name: Checkout repository |
| 125 | + uses: actions/checkout@v4 |
| 126 | + with: |
| 127 | + fetch-depth: 0 |
| 128 | + - name: Download coverage report |
| 129 | + uses: actions/download-artifact@v4 |
| 130 | + - name: Run SonarCloud scanner |
| 131 | + uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/sonarcloud@main |
| 132 | + with: |
| 133 | + sonar-token: ${{ secrets.SONAR_TOKEN }} |
0 commit comments