|
4 | 4 |
|
5 | 5 | * CI/CD
|
6 | 6 | * mini Pipeline
|
7 |
| - * Pytest |
| 7 | + * Pytest |
| 8 | + |
| 9 | +-- |
| 10 | + |
| 11 | +```yaml [|3-7|14-18|19-23|22|24-29|30-35] |
| 12 | +name: CI |
| 13 | + |
| 14 | +on: |
| 15 | + push: |
| 16 | + branches: [develop] |
| 17 | + pull_request: |
| 18 | + branches: [develop] |
| 19 | + |
| 20 | +jobs: |
| 21 | + test: |
| 22 | + name: CI Gate |
| 23 | + runs-on: windows-latest |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + fetch-depth: 0 |
| 30 | + - name: install tools, build and test |
| 31 | + run: | |
| 32 | + .\build.ps1 -install |
| 33 | + .\build.ps1 -target selftests |
| 34 | + shell: powershell |
| 35 | + - name: Publish Test Results |
| 36 | + uses: EnricoMi/publish-unit-test-result-action/composite@v2 |
| 37 | + if: always() |
| 38 | + with: |
| 39 | + files: | |
| 40 | + test/output/test-report.xml |
| 41 | + - uses: actions/upload-artifact@v2 |
| 42 | + with: |
| 43 | + name: artifacts.zip |
| 44 | + retention-days: 90 |
| 45 | + path: "build/**/artifacts.*" |
| 46 | + if-no-files-found: error |
| 47 | +``` |
| 48 | +
|
| 49 | +-- |
| 50 | +
|
| 51 | +<pre><code class="fragment powershell" data-trim> |
| 52 | +.\build.ps1 -target selftests |
| 53 | +</code></pre> |
| 54 | +
|
| 55 | +<pre><code class="fragment powershell" data-trim> |
| 56 | +python -m pipenv run python -m pytest test --junitxml=$pytestJunitXml |
| 57 | +</code></pre> |
| 58 | +
|
| 59 | +<pre><code class="fragment python" data-trim> |
| 60 | +def test_build(): |
| 61 | + assert 0 == SplBuild( |
| 62 | + variant="CustA/Disco", |
| 63 | + build_kit="prod", |
| 64 | + expected_artifacts=ArtifactsCollection( |
| 65 | + artifacts=["spled.exe", "compile_commands.json"] |
| 66 | + ), |
| 67 | + ).execute(target="all", strict=True, archive=True) |
| 68 | +</code></pre> |
| 69 | +
|
| 70 | +<pre><code class="fragment python" data-trim> |
| 71 | +def test_reports(): |
| 72 | + assert 0 == SplBuild( |
| 73 | + variant="CustA/Disco", |
| 74 | + build_kit="test", |
| 75 | + expected_artifacts=ArtifactsCollection(artifacts=["reports"]), |
| 76 | + ).execute(target="reports", strict=True, archive=True) |
| 77 | +</code></pre> |
| 78 | +
|
| 79 | +-- |
| 80 | +
|
| 81 | +* Mini CI-Pipeline |
| 82 | +* etwas Python-Kleber |
| 83 | +* CMake + C-test-Framework |
0 commit comments