Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH Actions workflow for testing C/C++ examples #121

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check Examples

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

concurrency:
group: build-examples-${{ github.head_ref || github.ref_name }}
cancel-in-progress: false

jobs:
build-examples:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Install HELICS from source (needed for C++ shared lib)
uses: gmlc-tdc/helics-action/install@main
with:
build_from_source: "true"

- uses: actions/checkout@v4

- name: Install Ninja
run: pipx install ninja

- name: Configure (Linux/macOS)
if: matrix.os != 'windows-latest'
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild

- name: Configure (Windows)
if: matrix.os == 'windows-latest'
run: cmake -Ax64 -DCMAKE_BUILD_TYPE=Release -Bbuild

- name: Build Examples
run: cmake --build build

# After building, if the job was triggered by a PR in another repository
# the results could be reported back to it as a comment
# report-results:
# name: Report Results
# needs: build-examples
# runs-on: ubuntu-latest
# if: always()
# steps:
# - uses: actions/checkout@v3
# - name: Run report script
# run: .ci/report-results.sh
# env:
# HELICSBOT_GH_TOKEN: ${{ secrets.HELICSBOT_GH_TOKEN }}
Loading