From 606c2925b9ca70e7e7da045997b59b35bacdf540 Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Thu, 9 Jan 2025 13:42:56 -0800 Subject: [PATCH 1/2] Add GH Actions workflow for testing C/C++ examples --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9676f15 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +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: 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 }} \ No newline at end of file From c0225a66d737550a9dc0f93e6f1ad4a2488c852a Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Tue, 14 Jan 2025 14:56:50 -0800 Subject: [PATCH 2/2] Install Ninja using pipx --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9676f15..8ab61a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,9 @@ jobs: - 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