Skip to content

Commit 5f6e8ab

Browse files
committed
Made compilation a matrix.
1 parent 6ebb28e commit 5f6e8ab

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

.github/workflows/Pipeline.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,16 @@ jobs:
8989
wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
9090
apptest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }}
9191

92-
C_Example:
92+
Examples:
9393
runs-on: ubuntu-24.04
9494
needs:
9595
- UnitTestingParams
9696
- Package
97+
strategy:
98+
matrix:
99+
include:
100+
- {example: "C", compiler: "gcc", fileext: "c"}
101+
- {example: "CXX", compiler: "g++", fileext: "cpp"}
97102
defaults:
98103
run:
99104
shell: bash
@@ -112,25 +117,19 @@ jobs:
112117
ls -l install
113118
python -m pip install -U --disable-pip-version-check --break-system-packages install/*.whl
114119
115-
- name: Generate versioning.c
120+
- name: Generate versioning.${{ matrix.fileext }}
116121
run: |
117-
cd example/C
118-
pyVersioning fillout ../../templates/C/versioning.c.template versioning.c
119-
cd ../CXX
120-
pyVersioning fillout ../../templates/CXX/versioning.cpp.template versioning.cpp
122+
cd example/${{ matrix.example }}
123+
pyVersioning fillout ../../templates/${{ matrix.example }}/versioning.${{ matrix.fileext }}.template versioning.${{ matrix.fileext }}
121124
122125
- name: Compile example
123126
run: |
124-
cd example/C
125-
gcc -o example example.c versioning.c
126-
cd ../CXX
127-
g++ -o example example.cpp versioning.cpp
127+
cd example/${{ matrix.example }}
128+
${{ matrix.compiler }} -o example example.${{ matrix.fileext }} versioning.${{ matrix.fileext }}
128129
129130
- name: Execute example
130131
run: |
131-
cd example/C
132-
./example
133-
cd ../CXX
132+
cd example/${{ matrix.example }}
134133
./example
135134
136135
PublishCoverageResults:
@@ -216,7 +215,7 @@ jobs:
216215
if: startsWith(github.ref, 'refs/tags')
217216
needs:
218217
- AppTesting
219-
- C_Example
218+
- Examples
220219
- PublishToGitHubPages
221220

222221
PublishOnPyPI:

example/fillout.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)