diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 8827993..2dcc876 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -34,6 +34,150 @@ jobs: with: files: ./metrix-distribution/target/itools-metrix.zip + cpp_centos7: + name: Package C++ CentOS7 + runs-on: ubuntu-latest + container: 'centos:centos7' + env: + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + steps: + - name: Update mirrors + run: | + sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo + + - name: Update Dependencies + run: | + yum update -y + + - name: Install Dependencies 1 + run: | + yum install -y epel-release + + - name: Install Dependencies 2 + run: | + yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils + + - name: Update mirrors again because why not + run: | + sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo + + - name: Install Dependencies 3 + run: | + yum install -y devtoolset-9 + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: '3.22.x' + + - name: Checkout sources + uses: actions/checkout@v3 + with: + repository: powsybl/powsybl-metrix + ref: refs/heads/windows-ci + + - name: Download Boost-release + uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1 + with: + repo: 'ARnDOSrte/Boost' + file: 'boost_1_73_0.zip' + target: 'boost_1_73_0.zip' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Unzip Boost + run: unzip boost_1_73_0.zip + + - name: Configure 3rd parties + run: | + source /opt/rh/devtoolset-9/enable + cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external + + - name: Build 3rd parties + run: | + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2 + + - name: Configure CMake + run: | + source /opt/rh/devtoolset-9/enable + cmake -S $GITHUB_WORKSPACE/metrix-simulator -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBoost_ROOT=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DBoost_INCLUDE_DIR=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install -B $GITHUB_WORKSPACE/metrix-simulator/build + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + - name: Prepare Metrix package + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-centos7" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload release package + uses: softprops/action-gh-release@v2 + with: + files: ${{ steps.metrix-install.outputs.archive_path }}.zip + + cpp_oraclelinux8: + name: Package C++ Oracle Linux 8 + runs-on: ubuntu-latest + container: 'oraclelinux:8' + steps: + - name: Install Boost + run: | + yum update -y + yum install cmake make gcc gcc-c++ which git + dnf --enablerepo=ol8_codeready_builder install boost-static + + - name: Checkout sources + uses: actions/checkout@v4 + with: + repository: powsybl/powsybl-metrix + ref: refs/heads/windows-ci + + - name: Configure 3rd parties + run: > + cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external + + - name: Build 3rd parties + run: > + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2 + + - name: Configure CMake + run: > + cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + - name: Prepare Metrix package + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-ol8" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload release package + uses: softprops/action-gh-release@v2 + with: + files: ${{ steps.metrix-install.outputs.archive_path }}.zip + cpp_ubuntu: name: Package C++ Ubuntu runs-on: ubuntu-latest