Skip to content

Commit eefb60e

Browse files
committed
Add GH Actions workflow for testing C/C++ examples
1 parent d345976 commit eefb60e

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Check Examples
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: build-examples-${{ github.head_ref || github.ref_name }}
12+
cancel-in-progress: false
13+
14+
jobs:
15+
build-examples:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
max-parallel: 3
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install HELICS from source (needed for C++ shared lib)
25+
uses: gmlc-tdc/helics-action/install@main
26+
with:
27+
build_from_source: "true"
28+
29+
- name: Configure (Linux/macOS)
30+
if: matrix.os != 'windows-latest'
31+
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
32+
working-directory: build
33+
34+
- name: Configure (Windows)
35+
if: matrix.os == 'windows-latest'
36+
run: cmake -Ax64 -DCMAKE_BUILD_TYPE=Release ..
37+
working-directory: build
38+
39+
- name: Build Examples
40+
run: cmake --build .
41+
working-directory: build
42+
43+
# After building, if the job was triggered by a PR in another repository
44+
# the results could be reported back to it as a comment
45+
# report-results:
46+
# name: Report Results
47+
# needs: build-examples
48+
# runs-on: ubuntu-latest
49+
# if: always()
50+
# steps:
51+
# - uses: actions/checkout@v3
52+
# - name: Run report script
53+
# run: .ci/report-results.sh
54+
# env:
55+
# HELICSBOT_GH_TOKEN: ${{ secrets.HELICSBOT_GH_TOKEN }}

0 commit comments

Comments
 (0)