[CI] upgrade GitHub actions #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS Binaries | |
on: | |
workflow_dispatch: | |
push: | |
tags-ignore: | |
- '**' | |
branches: | |
- '**' | |
release: | |
types: ['released', 'prereleased'] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Ninja | |
run: python3 -m pip install ninja | |
- name: Install Eigen | |
run: sudo VIRTUAL_ENV=/opt/local ./scripts/install-eigen.sh RelWithDebInfo | |
- name: Configure | |
run: | | |
cmake -B package -S QPALM \ | |
-G "Ninja Multi-Config" \ | |
-D BUILD_SHARED_LIBS=On \ | |
-DCMAKE_POSITION_INDEPENDENT_CODE=On \ | |
-DQPALM_WITH_CXX=On \ | |
-DQPALM_WITH_FORTRAN=On \ | |
-DCMAKE_Fortran_COMPILER=gfortran-11 | |
env: | |
CMAKE_PREFIX_PATH: /opt/local | |
- name: Build Debug | |
run: | | |
cmake --build package --config Debug -j | |
- name: Build Release | |
run: | | |
cmake --build package --config RelWithDebInfo -j | |
- name: Package | |
run: | | |
cpack -C "Debug;RelWithDebInfo" \ | |
-D CPACK_INSTALL_CMAKE_PROJECTS=".;QPALM;ALL;/;LADEL;LADEL;ALL;/" | |
working-directory: package | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: qpalm-macos | |
path: package/QPALM-*.tar.gz | |
test: | |
needs: [build] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Ninja | |
run: python3 -m pip install ninja | |
- name: Install Eigen | |
run: sudo VIRTUAL_ENV=/opt/local ./scripts/install-eigen.sh RelWithDebInfo | |
- name: Download | |
uses: actions/download-artifact@v4 | |
with: | |
name: qpalm-macos | |
path: package | |
- name: Install | |
run: | | |
sudo tar xzf package/QPALM-*.tar.gz --strip-components 1 \ | |
-C /opt/local | |
- name: Build examples (Release) | |
run: | | |
cmake -B build-examples -S examples -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_Fortran_COMPILER=gfortran-11 \ | |
-G "Ninja" | |
cmake --build build-examples -j | |
env: | |
CMAKE_PREFIX_PATH: /opt/local | |
- name: Run examples (Release) | |
run: | | |
./build-examples/c/qpalm_demo | |
./build-examples/cxx/qpalm_demo_cxx | |
./build-examples/fortran/qpalm_demo_fortran | |
- name: Build examples (Debug) | |
run: | | |
cmake -B build-examplesd -S examples -DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_Fortran_COMPILER=gfortran-11 \ | |
-G "Ninja" | |
cmake --build build-examplesd -j | |
env: | |
CMAKE_PREFIX_PATH: /opt/local | |
- name: Run examples (Debug) | |
run: | | |
./build-examplesd/c/qpalm_demo | |
./build-examplesd/cxx/qpalm_demo_cxx | |
./build-examplesd/fortran/qpalm_demo_fortran | |
release: | |
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }} | |
needs: [test] | |
runs-on: macos-latest | |
steps: | |
- name: Download | |
uses: actions/download-artifact@v4 | |
with: | |
name: qpalm-macos | |
path: package | |
- name: Release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
files: package/QPALM-*.tar.gz |