Ubuntu Release #13
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: Ubuntu Release | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- ci/* | |
workflow_dispatch: | |
workflow_run: | |
workflows: [ "Publish Release" ] | |
types: | |
- completed | |
release: | |
types: [ created ] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
jobs: | |
userguide: | |
runs-on: ubuntu-latest | |
outputs: | |
pdf-name: ${{ steps.create-user-guide.outputs.pdf-name }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Read antares-xpansion version | |
id: antares-xpansion-version | |
uses: ./.github/actions/read-json-value | |
with: | |
path: 'antares-version.json' | |
key: 'antares_xpansion_version' | |
- id: create-user-guide | |
name: user guide pdf creation | |
uses: ./.github/workflows/generate-userguide-pdf | |
with: | |
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}} | |
- name: user guide upload | |
id: userguide_upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: user-guide | |
path: ${{ steps.create-user-guide.outputs.pdf-path }} | |
build: | |
needs: userguide | |
runs-on: ${{ matrix.os }} | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
xprs: [ XPRESS-ON, XPRESS-OFF ] | |
env: | |
XPRESSDIR: ${{ github.workspace }}/xpress | |
XPRESS: ${{ github.workspace }}/xpress/bin | |
XPRS_LIB_Path: ${{ github.workspace }}/xpress/lib | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Checkout xpressmp linux | |
if: matrix.xprs == 'XPRESS-ON' | |
uses: actions/checkout@v3 | |
with: | |
repository: rte-france/xpress-mp | |
path: ${{ env.XPRESSDIR }} | |
ref: 8.13a | |
token: ${{ secrets.AS_TOKEN }} #reniew token periodically | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ matrix.os }}-${{ matrix.xprs }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-tests.txt | |
pip install -r requirements-ui.txt | |
- name: Install mandatory system libraries | |
run: | | |
sudo apt-get update --fix-missing | |
sudo apt-get install libjsoncpp-dev libgtest-dev libboost-mpi-dev libboost-program-options-dev libtbb-dev | |
cd /usr/src/googletest/ | |
sudo cmake . | |
sudo cmake --build . --target install | |
- name: Read antares-solver version | |
id: antares-version | |
uses: ./.github/actions/read-json-value | |
with: | |
path: 'antares-version.json' | |
key: 'antares_version' | |
- name: Read antares-xpansion version | |
id: antares-xpansion-version | |
uses: ./.github/actions/read-json-value | |
with: | |
path: 'antares-version.json' | |
key: 'antares_xpansion_version' | |
- name: Read antares-deps version | |
id: antares-deps-version | |
uses: ./.github/actions/read-json-value | |
with: | |
path: 'antares-version.json' | |
key: 'antares_deps_version' | |
- name: Download pre-compiled librairies | |
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz | |
with: | |
antares-deps-version: ${{steps.antares-deps-version.outputs.result}} | |
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: | |
prefix: "../rte-antares-deps-Release/" | |
- name: Download userguide | |
uses: actions/download-artifact@v3 | |
with: | |
name: user-guide | |
path: docs/ | |
- name: Configure | |
shell: bash | |
run: | | |
if [ ${{ matrix.xprs }} == "XPRESS-ON" ]; then | |
XPRESS_VALUE="ON" | |
else | |
XPRESS_VALUE="OFF" | |
fi | |
cmake -B _build -S . \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \ | |
-DBUILD_TESTING=ON \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=_install \ | |
-DBUILD_UI=ON \ | |
-DUSER_GUIDE_PATH="docs/${{ needs.userguide.outputs.pdf-name }}" \ | |
-DXPRESS=${{ env.XPRESS_VALUE }} \ | |
-DXPRESS_ROOT=${{ env.XPRESSDIR }} | |
- name: Build | |
run: | | |
cmake --build _build --config Release -j8 --target install | |
- name: set name variables | |
id: single_file_name | |
shell: bash | |
run: | | |
if [ ${{ matrix.xprs }} == "XPRESS-ON" ]; then | |
WITH_XPRS="-xpress" | |
else | |
WITH_XPRS="" | |
fi | |
VERSION=${{steps.antares-xpansion-version.outputs.result}}${WITH_XPRS} | |
echo "VERSION_WITH_XPRESS=$VERSION" >> $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: Installer .tar.gz creation | |
run: | | |
cd _build | |
export FILE_NAME="antaresXpansion-${{env.VERSION_WITH_XPRESS}}-${{ matrix.os }}" | |
cpack -G TGZ -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME | |
#Need to differentiate between xpress/no_xpress files | |
#Cpack command line doesn't seem to care about -P or -R options | |
echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV | |
- name: Running unit tests | |
run: | | |
cd _build | |
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 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: Get release | |
if: github.event_name == 'release' && github.event.action == 'created' | |
id: get_release | |
uses: bruceadams/get-release@main | |
- name: Upload Release Asset | |
if: github.event_name == 'release' && github.event.action == 'created' | |
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}} | |
######################## |