diff --git a/.github/workflows/build-userguide.yml b/.github/workflows/build-userguide.yml index c8752df8f3..fdd474a9c2 100644 --- a/.github/workflows/build-userguide.yml +++ b/.github/workflows/build-userguide.yml @@ -7,19 +7,21 @@ on: branches: - release/* - doc/* + workflow_call: + inputs: + run-tests: + required: true + type: boolean env: - IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }} + IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 if: "!contains(github.event.head_commit.message, '[skip ci]')" - strategy: - matrix: - os: [ubuntu-20.04] steps: - uses: actions/checkout@v3 @@ -27,7 +29,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.12 - name: Install dependencies run: | @@ -55,10 +57,12 @@ jobs: name: pdf-reference-guide path: ${{ env.PDF_PATH }} - - name: Upload user guide as release asset + + - name: Publish assets if: ${{ env.IS_RELEASE == 'true' }} - uses: alexellis/upload-assets@0.4.0 env: - GITHUB_TOKEN: ${{ github.token }} - with: - asset_paths: ${{ env.PDF_PATH_ASSET }} + GITHUB_TOKEN: ${{ github.token }} + tag: ${{ github.event.inputs.release_tag }} + run: | + gh release upload "$tag" ${{ env.PDF_PATH }} + diff --git a/.github/workflows/centos7.yml b/.github/workflows/centos7.yml index 418d7c09de..8ef8ca5a7a 100644 --- a/.github/workflows/centos7.yml +++ b/.github/workflows/centos7.yml @@ -8,10 +8,15 @@ on: - develop schedule: - cron: '21 2 * * *' + workflow_call: + inputs: + run-tests: + required: true + type: boolean env: GITHUB_TOKEN: ${{ github.token }} - IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }} + IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} IS_PUSH: ${{ github.event_name == 'push' }} jobs: @@ -110,21 +115,20 @@ jobs: with: path: _build/*.rpm - publish_assets: - name: Publish assets - needs: build - runs-on: ubuntu-latest - - steps: - - name: Download all artifacts + - name: Install gh if: ${{ env.IS_RELEASE == 'true' }} - uses: actions/download-artifact@v3 - + run: | + yum -y install dnf + dnf -y install 'dnf-command(config-manager)' + dnf -y config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + dnf -y install gh - name: Publish assets if: ${{ env.IS_RELEASE == 'true' }} - uses: alexellis/upload-assets@0.4.0 env: - GITHUB_TOKEN: ${{ github.token }} - with: - asset_paths: '["*/*.tar.gz", "*/*.rpm"]' + GITHUB_TOKEN: ${{ github.token }} + tag: ${{ github.event.inputs.release_tag }} + run: | + gh release upload "$tag" _build/*.tar.gz _build/*.rpm + + \ No newline at end of file diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml index 5a4c77da34..bdb156a776 100644 --- a/.github/workflows/new_release.yml +++ b/.github/workflows/new_release.yml @@ -13,26 +13,55 @@ on: description: "Run all tests (true/false)" required: true jobs: - release: - runs-on: ubuntu-20.04 - outputs: - url: ${{ steps.create_release.outputs.upload_url }} - steps: - - name: Release creation - uses: actions/create-release@v1 - id: create_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.event.inputs.release_tag }} - release_name: ${{ github.event.inputs.release_name }} - body: | - Please complete description - - - ubuntu: - name: Release - Ubuntu - needs: release - uses: ./.github/workflows/ubuntu.yml - with: - run-tests: ${{ fromJSON(inputs.run-tests) }} + release: + name: Release pushed tag + runs-on: ubuntu-20.04 + steps: + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.event.inputs.release_tag }} + title: ${{ github.event.inputs.release_name }} + tests: ${{ github.event.inputs.run-tests }} + run: | + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="$title" \ + --notes="Run tests: $tests" + + + + ubuntu: + name: Release - Ubuntu + needs: release + uses: ./.github/workflows/ubuntu.yml + with: + run-tests: ${{ fromJSON(inputs.run-tests) }} + + windows: + name: Release - Windows + needs: release + uses: ./.github/workflows/windows-vcpkg.yml + with: + run-tests: ${{ fromJSON(inputs.run-tests) }} + + centos7: + name: Release - centos7 + needs: release + uses: ./.github/workflows/centos7.yml + with: + run-tests: ${{ fromJSON(inputs.run-tests) }} + + oracle8: + name: Release - oracle8 + needs: release + uses: ./.github/workflows/oracle8.yml + with: + run-tests: ${{ fromJSON(inputs.run-tests) }} + + user_guide: + name: User Guide + needs: release + uses: ./.github/workflows/build-userguide.yml + with: + run-tests: ${{ fromJSON(inputs.run-tests) }} diff --git a/.github/workflows/oracle8.yml b/.github/workflows/oracle8.yml index 75c05f845f..2c0ea15c5e 100644 --- a/.github/workflows/oracle8.yml +++ b/.github/workflows/oracle8.yml @@ -8,10 +8,15 @@ on: - develop schedule: - cron: '21 2 * * *' + workflow_call: + inputs: + run-tests: + required: true + type: boolean env: GITHUB_TOKEN: ${{ github.token }} - IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }} + IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} IS_PUSH: ${{ github.event_name == 'push' }} jobs: @@ -33,7 +38,7 @@ jobs: - name: Install libraries run: | - dnf install -y epel-release git cmake wget rpm-build redhat-lsb-core + dnf install -y epel-release git cmake wget rpm-build redhat-lsb-core dnf install -y unzip libuuid-devel boost-test boost-devel gcc-toolset-10-toolchain zlib-devel - name: Checkout @@ -99,21 +104,18 @@ jobs: with: path: _build/*.rpm - publish_assets: - name: Publish assets - needs: build - runs-on: ubuntu-latest - - steps: - - name: Download all artifacts + - name: Install gh if: ${{ env.IS_RELEASE == 'true' }} - uses: actions/download-artifact@v3 - + run: | + dnf -y install 'dnf-command(config-manager)' + dnf -y config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + dnf -y install gh - name: Publish assets if: ${{ env.IS_RELEASE == 'true' }} - uses: alexellis/upload-assets@0.4.0 env: - GITHUB_TOKEN: ${{ github.token }} - with: - asset_paths: '["*/*.tar.gz", "*/*.rpm"]' + GITHUB_TOKEN: ${{ github.token }} + tag: ${{ github.event.inputs.release_tag }} + run: | + gh release upload "$tag" _build/*.tar.gz _build/*.rpm + diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c4525581f5..763590cd8d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -30,24 +30,18 @@ jobs: name: Build env: ORTOOLS_DIR: ${{ github.workspace }}/or-tools + OS: ubuntu-20.04 - outputs: - os: ${{ matrix.os }} - - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 if: "!contains(github.event.head_commit.message, '[skip ci]')" - strategy: - matrix: - os: [ubuntu-20.04] - test-platform: [ubuntu-20.04] - + steps: - uses: actions/checkout@v3 - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: ${{ matrix.os }} + key: ${{ runner.name }} - name: Install libraries run: | @@ -72,7 +66,7 @@ jobs: uses: ./.github/workflows/download-extract-precompiled-libraries-tgz with: antares-deps-version: ${{steps.antares-deps-version.outputs.prop}} - os: ${{matrix.os}} + os: ${{env.OS}} ortools-url: ${{env.ORTOOLS_URL}} ortools-dir: ${{env.ORTOOLS_DIR}} @@ -127,7 +121,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-named-mps - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} variant: "named-mps" - name: Run unfeasibility-related tests @@ -140,7 +134,7 @@ jobs: if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} run: | cd _build - ctest -C ${{ matrix.buildtype }} --output-on-failure -L "unit|end-to-end" + ctest -C Release --output-on-failure -L "unit|end-to-end" - name: Upload logs for failed tests if: ${{ failure() }} @@ -155,7 +149,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-v830 - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run MILP with CBC if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} @@ -164,7 +158,7 @@ jobs: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-milp variant: "milp-cbc" - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run tests introduced in v860 if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} @@ -172,7 +166,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-v860 - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run tests introduced in v870 if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} @@ -180,7 +174,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-v870 - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run short-tests if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} @@ -188,7 +182,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: short-tests - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run mps tests if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} @@ -196,7 +190,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-mps - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run tests for adequacy patch (CSR) if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} @@ -204,7 +198,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: adequacy-patch-CSR - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run parallel tests if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -212,7 +206,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-parallel - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} variant: "parallel" - name: Run medium-tests @@ -221,7 +215,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: medium-tests - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run long-tests-1 if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -229,7 +223,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: long-tests-1 - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run long-tests-2 if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -237,7 +231,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: long-tests-2 - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Run long-tests-3 if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -245,7 +239,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: long-tests-3 - os: ${{ matrix.test-platform }} + os: ${{ env.OS }} - name: Installer .deb creation run: | @@ -276,11 +270,12 @@ jobs: uses: actions/upload-artifact@v3 with: path: _build/*.deb - + + - name: Publish assets if: ${{ env.IS_RELEASE == 'true' }} - uses: alexellis/upload-assets@0.4.0 env: - GITHUB_TOKEN: ${{ github.token }} - with: - asset_paths: '["_build/*.tar.gz", "_build/*.deb"]' + GITHUB_TOKEN: ${{ github.token }} + tag: ${{ github.event.inputs.release_tag }} + run: | + gh release upload "$tag" _build/*.tar.gz _build/*.deb diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index a7674fd76b..03f82d4fcc 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -12,25 +12,33 @@ on: - doc/* schedule: - cron: '21 2 * * *' + workflow_call: + inputs: + run-tests: + required: true + type: boolean + +env: + GITHUB_TOKEN: ${{ github.token }} + IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} + RUN_SIMPLE_TESTS: ${{ github.event_name == 'push' || inputs.run-tests == 'true' }} + RUN_EXTENDED_TESTS: ${{ github.event_name == 'schedule' || inputs.run-tests == 'true' }} + jobs: - windows: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - buildtype: [release] - include: - - os: windows-latest - triplet: x64-windows - vcpkgPackages: wxwidgets boost-test - test-platform: windows-2022 + build: + env: # Indicates the location of the vcpkg as a Git submodule of the project repository. VCPKG_ROOT: ${{ github.workspace }}/vcpkg ORTOOLS_DIR: ${{ github.workspace }}/or-tools RUN_EXTENDED_TESTS: ${{ github.event_name == 'schedule'}} + OS: windows-latest + test-platform: windows-2022 + vcpkgPackages: wxwidgets boost-test + triplet: x64-windows + + runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -82,13 +90,13 @@ jobs: # The key includes: hash of the vcpkg.json file, the hash of the vcpkg Git commit id, and the used vcpkg's triplet. The vcpkg's commit id would suffice, but computing an hash out it does not harm. # Note: given a key, the cache content is immutable. If a cache entry has been created improperly, in order the recreate the right content the key must be changed as well, and it must be brand new (i.e. not existing already). key: | - ${{ hashFiles( 'vcpkg_manifest/vcpkg.json' ) }}-${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}-${{ matrix.triplet }} + ${{ hashFiles( 'vcpkg_manifest/vcpkg.json' ) }}-${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}-${{ env.triplet }} - name : Install deps with VCPKG run: | cd vcpkg ./bootstrap-vcpkg.sh - vcpkg install ${{matrix.vcpkgPackages}} --triplet ${{matrix.triplet}} + vcpkg install ${{env.vcpkgPackages}} --triplet ${{env.triplet}} rm -rf buildtrees packages downloads shell: bash @@ -103,7 +111,7 @@ jobs: uses: ./.github/workflows/download-extract-precompiled-libraries-zip with: antares-deps-version: ${{steps.antares-deps-version.outputs.prop}} - os: ${{matrix.os}} + os: ${{env.OS}} ortools-url: ${{env.ORTOOLS_URL}} ortools-dir: ${{env.ORTOOLS_DIR}} @@ -132,7 +140,7 @@ jobs: -DDEPS_INSTALL_DIR=rte-antares-deps-Release \ -DCMAKE_PREFIX_PATH="${{ env.ORTOOLS_DIR }}/install" \ -DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \ - -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \ + -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} \ -DCMAKE_BUILD_TYPE=release \ -DBUILD_TESTING=ON \ -DBUILD_TOOLS=ON \ @@ -144,16 +152,34 @@ jobs: shell: bash run: | cmake --build _build --config release -j2 + # simtest + - name: Read simtest version + id: simtest-version + uses: notiz-dev/github-action-json-property@release + with: + path: 'simtest.json' + prop_path: 'version' + + - name: Run named mps tests + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} + uses: ./.github/workflows/run-tests + with: + simtest-tag: ${{steps.simtest-version.outputs.prop}} + batch-name: valid-named-mps + os: ${{ env.test-platform }} + variant: "named-mps" - name: Run unfeasibility-related tests + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} run: | cd _build ctest -C Release --output-on-failure -R "^unfeasible$" - name: Run unit and end-to-end tests + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} run: | cd _build - ctest -C ${{ matrix.buildtype }} --output-on-failure -L "unit|end-to-end" -LE ortools + ctest -C Release --output-on-failure -L "unit|end-to-end" -LE ortools - name: Upload build on failure if: ${{ failure() }} @@ -162,73 +188,63 @@ jobs: name: MPS-diff path: ${{ github.workspace }}/src/tests/mps - # simtest - - name: Read simtest version - id: simtest-version - uses: notiz-dev/github-action-json-property@release - with: - path: 'simtest.json' - prop_path: 'version' - - - name: Run named mps tests - uses: ./.github/workflows/run-tests - with: - simtest-tag: ${{steps.simtest-version.outputs.prop}} - batch-name: valid-named-mps - os: ${{ matrix.test-platform }} - variant: "named-mps" - + - name: Run tests for adequacy patch (CSR) + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: adequacy-patch-CSR - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run tests about infinity on BCs RHS + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-v830 - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run MILP with CBC - if: ${{ env.IS_PUSH == 'true' }} + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-milp variant: "milp-cbc" - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run tests introduced in v860 + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-v860 - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run tests introduced in v870 - if: ${{ env.IS_PUSH == 'true' }} + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-v870 - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run short-tests + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: short-tests - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run mps tests + if: ${{ env.RUN_SIMPLE_TESTS == 'true' }} uses: ./.github/workflows/run-tests with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-mps - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run parallel tests if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -236,7 +252,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: valid-parallel - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} variant: "parallel" - name: Run medium-tests @@ -245,7 +261,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: medium-tests - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run long-tests-1 if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -253,7 +269,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: long-tests-1 - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run long-tests-2 if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -261,7 +277,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: long-tests-2 - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Run long-tests-3 if: ${{ env.RUN_EXTENDED_TESTS == 'true' }} @@ -269,7 +285,7 @@ jobs: with: simtest-tag: ${{steps.simtest-version.outputs.prop}} batch-name: long-tests-3 - os: ${{ matrix.test-platform }} + os: ${{ env.test-platform }} - name: Solver archive creation shell: bash @@ -303,7 +319,11 @@ jobs: with: path: _build/${{env.NSIS_NAME}} - - name: Archive upload - uses: actions/upload-artifact@v3 - with: - path: _build/*.zip + - name: Publish assets + if: ${{ env.IS_RELEASE == 'true' }} + env: + GITHUB_TOKEN: ${{ github.token }} + tag: ${{ github.event.inputs.release_tag }} + run: | + gh release upload "$tag" _build/*.zip + shell: bash