Skip to content

Commit 35b59c3

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

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/ci.yml

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

0 commit comments

Comments
 (0)