Merge branch 'main' into fixrelease_groovydoc #271
Workflow file for this run
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: CI | |
on: [push] | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
container: ${{ matrix.config.container }} | |
strategy: | |
matrix: | |
config: | |
- { | |
name: linux, | |
os: ubuntu-20.04, | |
container: 'ubuntu:18.04', | |
cmake_options: '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5 -DCMAKE_C_COMPILER=/usr/bin/gcc-5', | |
artifact_name: libmath.so, | |
artifact_path: linux_64 | |
} | |
- { | |
name: macos, | |
os: macos-11, | |
artifact_name: libmath.dylib, | |
artifact_path: osx_64 | |
} | |
- { | |
name: windows, | |
os: windows-2019, | |
artifact_name: math.dll, | |
artifact_path: windows_64 | |
} | |
steps: | |
# by default ubuntu 18.04 is shipped with cmake 3.10, to get a more recent version we get it from kitware repo | |
- name: Install pre-requisites | |
if: matrix.config.name == 'linux' | |
run: | | |
apt update | |
apt-get install -y g++-5 gcc-5 liblapack-dev libblas-dev ca-certificates gnupg software-properties-common wget git maven | |
wget https://apt.kitware.com/keys/kitware-archive-latest.asc | |
apt-key add kitware-archive-latest.asc | |
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' | |
apt-get update | |
apt-get install -y cmake | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Configure CMake | |
shell: bash | |
run: cmake -DCMAKE_BUILD_TYPE=Release ${{ matrix.config.cmake_options }} -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build | |
- name: Build | |
shell: bash | |
run: cmake --build $GITHUB_WORKSPACE/build --parallel --config Release | |
- name: Test | |
shell: bash | |
run: mvn --batch-mode package | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.config.artifact_name }} | |
path: ${{ runner.workspace }}/powsybl-math-native/target/classes/natives/${{ matrix.config.artifact_path }}/${{ matrix.config.artifact_name }} | |
package: | |
name: Package libraries to JAR | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Download Linux library | |
uses: actions/download-artifact@v3 | |
with: | |
name: libmath.so | |
path: target/classes/natives/linux_64/ | |
- name: Download MacOS library | |
uses: actions/download-artifact@v3 | |
with: | |
name: libmath.dylib | |
path: target/classes/natives/osx_64/ | |
- name: Download Windows library | |
uses: actions/download-artifact@v3 | |
with: | |
name: math.dll | |
path: target/classes/natives/windows_64/ | |
- name: Build Jar | |
shell: bash | |
run: mvn -DskipTests install | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: powsybl-math-native.jar | |
path: target/*.jar |