diff --git a/.github/workflows/build-userguide.yml b/.github/workflows/build-userguide.yml index 7c55d1be3..45d07abc2 100644 --- a/.github/workflows/build-userguide.yml +++ b/.github/workflows/build-userguide.yml @@ -25,7 +25,7 @@ jobs: - name: Get release if: github.event_name == 'release' && github.event.action == 'created' id: get_release - uses: bruceadams/get-release@v1.2.3 + uses: bruceadams/get-release@main - name: Read antares-xpansion version id: antares-xpansion-version diff --git a/.github/workflows/build_centos7.yml b/.github/workflows/build_centos7.yml index 00df30360..2c452a584 100644 --- a/.github/workflows/build_centos7.yml +++ b/.github/workflows/build_centos7.yml @@ -111,11 +111,11 @@ jobs: os: centos7 os-full-name: CentOS-7.9.2009 #variant: -ortools-xpress - + - name: Compile Boost uses: ./.github/workflows/compile-boost - with: - prefix: "../rte-antares-deps-Release/" + with: + prefix: "../rte-antares-deps-Release/" - name: Install dependencies run: | diff --git a/.github/workflows/build_ubuntu.yml b/.github/workflows/build_ubuntu.yml index f4eb3afdb..970f9e99b 100644 --- a/.github/workflows/build_ubuntu.yml +++ b/.github/workflows/build_ubuntu.yml @@ -93,12 +93,12 @@ jobs: antares-version: ${{steps.antares-version.outputs.result}} os: ${{matrix.os}} os-full-name: Ubuntu-20.04 - + - name: Compile Boost uses: ./.github/workflows/compile-boost - with: + with: prefix: "../rte-antares-deps-Release/" - + - name: Configure shell: bash #XPRESS_VALUE = ${{ matrix.xprs }} == "XPRESS-ON" ? "ON" : "OFF" diff --git a/.github/workflows/centos7-system.yml b/.github/workflows/centos-release.yml similarity index 81% rename from .github/workflows/centos7-system.yml rename to .github/workflows/centos-release.yml index b2ac1d2c5..6c037ca74 100644 --- a/.github/workflows/centos7-system.yml +++ b/.github/workflows/centos-release.yml @@ -1,4 +1,4 @@ -name: Centos7 CI (bare docker image) +name: Centos7 release on: push: @@ -16,9 +16,7 @@ env: jobs: docker_publish: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@master @@ -116,7 +114,9 @@ jobs: XPRESSDIR_CONTAINER: ${GITHUB_WORKSPACE}/xpress XPRESS_CONTAINER: ${GITHUB_WORKSPACE}/xpress/bin XPRS_LIB_Path_CONTAINER: ${GITHUB_WORKSPACE}/xpress/lib - + outputs: + zip_name: ${{ steps.zip_name.outputs.zip_name }} + singlefile_name: ${{ steps.zip_name.outputs.singlefile_name }} steps: - id: branch-name uses: tj-actions/branch-names@v6 @@ -134,12 +134,12 @@ jobs: os: centos7 os-full-name: CentOS-7.9.2009 #variant: -ortools-xpress - + - name: Compile Boost uses: ./.github/workflows/compile-boost - with: + with: prefix: "../rte-antares-deps-Release/" - + - name: Install dependencies run: | pip3 install -r requirements-tests.txt @@ -191,6 +191,17 @@ jobs: export PATH=/usr/lib64/openmpi/bin:$PATH cmake3 --build _build --config Release -j2 --target install + - name: Running unit tests + timeout-minutes: 120 + shell: bash + run: | + source /etc/profile.d/modules.sh + module load mpi + export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }} + export XPRESS=${{ env.XPRESS_CONTAINER }} + cd _build + ctest3 -C Release --output-on-failure -L "unit|benders|lpnamer|medium" + - name: set name variables id: single_file_name shell: bash @@ -210,30 +221,17 @@ jobs: cpack3 -G TGZ -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV - - name: Installer .rpm creation - run: | - cd _build - export FILE_NAME="antaresXpansion-${{env.VERSION_WITH_XPRESS}}-CentOS-7.9.2009" - cpack3 -G RPM -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME -D CPACK_OUTPUT_FILE_NAME=$FILE_NAME.rpm - echo "RPM_NAME=$FILE_NAME.rpm" >> $GITHUB_ENV - - - id: create-single-file - name: Single file .tar.gz creation - uses: ./.github/workflows/single-file-creation-tgz - with: - antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}} - - name: Upload .tar.gz uses: actions/upload-artifact@v3 with: name: ${{env.TGZ_NAME}} path: _build/${{env.TGZ_NAME}} - - name: Upload rpm - uses: actions/upload-artifact@v3 + - id: create-single-file + name: Single file .tar.gz creation + uses: ./.github/workflows/single-file-creation-tgz with: - name: ${{env.RPM_NAME}} - path: _build/${{env.RPM_NAME}} + antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}} - name: Upload single file uses: actions/upload-artifact@v3 @@ -241,45 +239,43 @@ jobs: name: ${{ steps.create-single-file.outputs.archive-name }} path: ${{ steps.create-single-file.outputs.archive-path }} - - name: Running unit tests - timeout-minutes: 120 - shell: bash + - id: zip_name run: | - source /etc/profile.d/modules.sh - module load mpi - export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }} - export XPRESS=${{ env.XPRESS_CONTAINER }} - cd _build - ctest3 -C Release --output-on-failure -L "unit|benders|lpnamer|medium" + echo "singlefile_name=${{steps.create-single-file.outputs.archive-name}}" >> "$GITHUB_OUTPUT" + echo "zip_name=${{env.TGZ_NAME}}" >> "$GITHUB_OUTPUT" + ####################### + upload_asset_to_release: + if: github.event_name == 'release' && github.event.action == 'created' + runs-on: ubuntu-latest + needs: build + env: + ZIP_NAME: ${{needs.build.outputs.zip_name}} + SINGLEFILE_NAME: ${{needs.build.outputs.singlefile_name}} + steps: - name: Get release if: github.event_name == 'release' && github.event.action == 'created' id: get_release - uses: bruceadams/get-release@v1.2.3 + uses: bruceadams/get-release@main - - name: Publish .tar.gz - if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 + - name: Download Artifact + uses: actions/download-artifact@v3 with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: _build/${{env.TGZ_NAME}} - asset_name: ${{env.TGZ_NAME}} - asset_content_type: application/octet-stream + name: $ZIP_NAME + path: . - - name: Publish .rpm - if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 + - name: Download Artifact + uses: actions/download-artifact@v3 with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: _build/${{env.RPM_NAME}} - asset_name: ${{env.RPM_NAME}} - asset_content_type: application/octet-stream + name: $SINGLEFILE_NAME + path: . - - name: Publish single file - if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ${{ steps.create-single-file.outputs.archive-path }} - asset_name: ${{ steps.create-single-file.outputs.archive-name }} - asset_content_type: application/octet-stream + - name: Upload Release Asset + env: + GH_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} $ZIP_NAME + gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} $SINGLEFILE_NAME + + ######################## \ No newline at end of file diff --git a/.github/workflows/centos7-system-deps-build.yml b/.github/workflows/centos7-system-deps-build.yml index c4193ed0b..25ecb97b1 100644 --- a/.github/workflows/centos7-system-deps-build.yml +++ b/.github/workflows/centos7-system-deps-build.yml @@ -68,21 +68,21 @@ jobs: git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ steps.branch-name.outputs.current_branch }} . git submodule update --init - + - name: Install dependencies run: | pip3 install -r requirements-tests.txt pip3 install -r requirements-ui.txt - + - name: Compile Boost uses: ./.github/workflows/compile-boost - with: + with: prefix: "../rte-antares-deps-Release/" - name: Compile tbb - uses: ./.github/workflows/compile-tbb - + uses: ./.github/workflows/compile-tbb + - name: Configure run: | source /opt/rh/devtoolset-9/enable diff --git a/.github/workflows/ubuntu-system.yml b/.github/workflows/ubuntu-release.yml similarity index 80% rename from .github/workflows/ubuntu-system.yml rename to .github/workflows/ubuntu-release.yml index b75a0ed4e..f2a4319d1 100644 --- a/.github/workflows/ubuntu-system.yml +++ b/.github/workflows/ubuntu-release.yml @@ -1,4 +1,4 @@ -name: Ubuntu CI +name: Ubuntu Release on: push: @@ -186,65 +186,37 @@ jobs: #Cpack command line doesn't seem to care about -P or -R options echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV - - name: Installer .deb creation + - name: Running unit tests run: | cd _build - export FILE_NAME="antaresXpansion-${{env.VERSION_WITH_XPRESS}}-${{ matrix.os }}" - cpack -G DEB -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME - echo "DEB_NAME=$FILE_NAME.deb" >> $GITHUB_ENV + ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer" + #Uploads are not necessary for release but useful in other cases - name: Upload .tar.gz uses: actions/upload-artifact@v3 with: name: ${{env.TGZ_NAME}} path: _build/${{env.TGZ_NAME}} - - name: Upload .deb - uses: actions/upload-artifact@v3 - with: - name: ${{env.DEB_NAME}} - path: _build/${{env.DEB_NAME}} - - name: Upload single file uses: actions/upload-artifact@v3 with: name: ${{ steps.create-single-file.outputs.archive-name }} path: ${{ steps.create-single-file.outputs.archive-path }} - - name: Running unit tests - run: | - cd _build - ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer" + ####################### - name: Get release if: github.event_name == 'release' && github.event.action == 'created' id: get_release - uses: bruceadams/get-release@v1.2.3 + uses: bruceadams/get-release@main - - name: Publish .tar.gz + - name: Upload Release Asset if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: _build/${{env.TGZ_NAME}} - asset_name: ${{env.TGZ_NAME}} - asset_content_type: application/octet-stream - - - name: Publish .deb - if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: _build/${{env.DEB_NAME}} - asset_name: ${{env.DEB_NAME}} - asset_content_type: application/octet-stream - - - name: Publish single file - if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ${{ steps.create-single-file.outputs.archive-path }} - asset_name: ${{ steps.create-single-file.outputs.archive-name }} - asset_content_type: application/octet-stream + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${{ steps.get_release.outputs.tag_name }} _build/${{env.TGZ_NAME}} + gh release upload ${{ steps.get_release.outputs.tag_name }} _build/${{env.TGZ_NAME}} + ######################## \ No newline at end of file diff --git a/.github/workflows/ubuntu-system-deps-build.yml b/.github/workflows/ubuntu-system-deps-build.yml index 1eb727178..3985ce4d0 100644 --- a/.github/workflows/ubuntu-system-deps-build.yml +++ b/.github/workflows/ubuntu-system-deps-build.yml @@ -43,12 +43,12 @@ jobs: cd /usr/src/googletest/ sudo cmake . sudo cmake --build . --target install - + - name: Compile Boost uses: ./.github/workflows/compile-boost - with: + with: prefix: "../rte-antares-deps-Release/" - + - name: Read antares-xpansion version id: antares-xpansion-version diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index 9ac73ecff..a836b7a33 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -1,4 +1,4 @@ -name: Windows CI +name: Windows release on: push: @@ -43,7 +43,7 @@ jobs: name: user-guide path: ${{ steps.create-user-guide.outputs.pdf-path }} - windows: + build: needs: userguide runs-on: ${{ matrix.os }} if: "!contains(github.event.head_commit.message, '[skip ci]')" @@ -58,7 +58,8 @@ jobs: XPRS_LIB_Path: ${{ github.workspace }}\xpress\lib # Indicates the location of the vcpkg as a Git submodule of the project repository. VCPKG_ROOT: ${{ github.workspace }}/vcpkg - + outputs: + zip_name: ${{ steps.zip_name.outputs.zip_name }} steps: - uses: actions/checkout@v3 with: @@ -80,7 +81,7 @@ jobs: if: github.event_name == 'release' && github.event.action == 'created' id: get_release uses: - bruceadams/get-release@v1.2.3 + bruceadams/get-release@main - name: Set up Python uses: actions/setup-python@v4 @@ -178,6 +179,14 @@ jobs: run: | cmake --build _build --config Release -j2 --target install + - name: Running unit tests + shell: cmd + run: | + set PATH=%PATH%;C:\Program Files\Microsoft MPI\Bin\ + set PATH=%PATH%;${{ env.XPRESS }} + cd _build + ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer" + - name: Create installer .zip shell: bash run: | @@ -197,46 +206,61 @@ jobs: echo "VERSION_WITH_XPRESS=$VERSION" echo "VERSION_WITH_XPRESS=$VERSION" >> $GITHUB_ENV - - name: Create single file .zip - id: create-single-file - uses: ./.github/workflows/single-file-creation-zip - with: - antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}} - - name: Upload installer uses: actions/upload-artifact@v3 with: name: ${{env.ZIP_NAME}} path: _build/${{env.ZIP_NAME}} + - name: Create single file .zip + id: create-single-file + uses: ./.github/workflows/single-file-creation-zip + with: + antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}} + - name: Upload single file uses: actions/upload-artifact@v3 with: name: ${{ steps.create-single-file.outputs.archive-name }} path: ${{ steps.create-single-file.outputs.archive-path }} - - name: Running unit tests - shell: cmd + - id: zip_name + shell: bash run: | - set PATH=%PATH%;C:\Program Files\Microsoft MPI\Bin\ - set PATH=%PATH%;${{ env.XPRESS }} - cd _build - ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer" + echo "zip_name=${{env.ZIP_NAME}}" >> "$GITHUB_OUTPUT" + echo "singlefile_name=${{steps.create-single-file.outputs.archive-name}}" >> "$GITHUB_OUTPUT" - - name: Publish installer + upload_asset_to_release: + if: github.event_name == 'release' && github.event.action == 'created' + runs-on: ubuntu-latest + needs: build + env: + ZIP_NAME: ${{needs.build.outputs.zip_name}} + SINGLEFILE_NAME: ${{needs.build.outputs.singlefile_name}} + steps: + - name: Get release if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 + id: get_release + uses: bruceadams/get-release@main + + - name: Download Artifact + uses: actions/download-artifact@v3 with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: _build/${{env.ZIP_NAME}} - asset_name: ${{env.ZIP_NAME}} - asset_content_type: application/octet-stream + name: $ZIP_NAME + path: . - - name: Publish single file - if: github.event_name == 'release' && github.event.action == 'created' - uses: actions/upload-release-asset@v1.0.2 + - name: Download Artifact + uses: actions/download-artifact@v3 with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ${{ steps.create-single-file.outputs.archive-path }} - asset_name: ${{ steps.create-single-file.outputs.archive-name }} - asset_content_type: application/octet-stream + name: $SINGLEFILE_NAME + path: . + + - name: Upload Release Asset + env: + GH_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} $ZIP_NAME + gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} $SINGLEFILE_NAME + + ######################## \ No newline at end of file