Skip to content

Commit

Permalink
Rewrite update-swig-interfaces action to be a composite action (#44)
Browse files Browse the repository at this point in the history
Fixes #43

Rewrite the `update-swig-interfaces` action to be a composite action.

* Update `update-swig-interfaces/action.yml` to use a composite action instead of a Docker-based action.
* Install `swig` using `pip` in the composite action.
* Remove the MATLAB-related code from the action.
* Set common CMake options in a single place for reuse.
* Add steps to generate Java, Python, C#, and Octave interface files based on inputs.
* Remove `update-swig-interfaces/Dockerfile` and `update-swig-interfaces/entrypoint.sh`.
* Update `.github/dependabot.yml` to remove the `docker` package-ecosystem entry for `update-swig-interfaces/`.
  • Loading branch information
nightlark authored Oct 10, 2024
1 parent 8c618b8 commit a8f1e59
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 67 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ updates:
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "docker"
directory: "update-swig-interfaces/"
schedule:
interval: "daily"
3 changes: 0 additions & 3 deletions update-swig-interfaces/Dockerfile

This file was deleted.

53 changes: 48 additions & 5 deletions update-swig-interfaces/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Update SWIG Interface Files"
description: "Runs swig to generate updated interface files for the HELICS language bindings"
inputs:
matlab:
description: "Generate Matlab interface files"
default: false
java:
description: "Generate Java interface files"
default: true
Expand All @@ -17,5 +14,51 @@ inputs:
description: "Generate Octave interface files (NOT SUPPORTED - DOES NOTHING)"
default: false
runs:
using: "docker"
image: "Dockerfile"
using: "composite"
steps:
- name: Install swig
run: pip install swig

- name: Set common CMake options
id: set-common-options
run: echo "COMMON_CMAKE_OPTIONS=-DHELICS_SWIG_GENERATE_INTERFACE_FILES_ONLY=ON -DHELICS_OVERWRITE_INTERFACE_FILES=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_ENABLE_ZMQ_CORE=OFF -DHELICS_BUILD_TESTS=OFF -DHELICS_BUILD_APP_EXECUTABLES=OFF -DHELICS_DISABLE_BOOST=ON -DHELICS_ENABLE_SWIG=ON" >> $GITHUB_ENV

- name: Generate Java interface files
if: inputs.java == 'true'
run: |
rm -rf interfaces/java/interface/*
mkdir build_java_interface
pushd build_java_interface || exit
cmake -DHELICS_BUILD_JAVA_INTERFACE=ON ${{ env.COMMON_CMAKE_OPTIONS }} ..
make -j2 javafile_overwrite
popd || exit
- name: Generate Python interface files
if: inputs.python == 'true'
run: |
rm -rf interfaces/python/interface/* || true
mkdir build_python_interface
pushd build_python_interface || exit
cmake -DHELICS_BUILD_PYTHON_INTERFACE=ON ${{ env.COMMON_CMAKE_OPTIONS }} ..
make -j2 pythonfile_overwrite
popd || exit
- name: Generate C# interface files
if: inputs.csharp == 'true'
run: |
rm -rf interfaces/csharp/interface/* || true
mkdir build_csharp_interface
pushd build_csharp_interface || exit
cmake -DHELICS_BUILD_CSHARP_INTERFACE=ON ${{ env.COMMON_CMAKE_OPTIONS }} ..
make -j2 csharpfile_overwrite
popd || exit
- name: Generate Octave interface files
if: inputs.octave == 'true'
run: |
rm -rf interfaces/octave/interface/* || true
mkdir build_octave_interface
pushd build_octave_interface || exit
cmake -DHELICS_BUILD_OCTAVE_INTERFACE=ON ${{ env.COMMON_CMAKE_OPTIONS }} ..
make -j2 octavefile_overwrite
popd || exit
54 changes: 0 additions & 54 deletions update-swig-interfaces/entrypoint.sh

This file was deleted.

0 comments on commit a8f1e59

Please sign in to comment.