-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/vcpkg linux #2078
Feature/vcpkg linux #2078
Changes from 50 commits
a5ace26
a532ded
4d88b9f
01c1719
ce6f0ee
aaf56be
8215e8c
ff51823
33541eb
54d2717
4fa2567
ddf60fd
82f866b
fb49715
c64b687
a71f0ca
1b19dfb
eeca546
bcb14cc
64b59bb
8d996a1
5e26bbd
c6fa5b9
3339c9e
e675c96
9e426f8
72f62ef
b3de6f3
cd23b2c
83331e0
6b71d90
62a6e8f
0a52474
9f3b2c1
e4953d5
512a091
046436d
ff0d261
3e78a3c
3e1ea50
1671e1e
af6210d
66bf8fa
53dfa9b
8e49f12
be5b618
a914c32
40a9f3b
fd13a66
d4924c9
1b16bda
e2694b5
e526cba
5bc828e
f2546c4
46788eb
38c49f6
ebae478
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,28 @@ jobs: | |
yum install -y centos-release-scl | ||
yum install -y devtoolset-10-gcc* | ||
|
||
- uses: ./.github/workflows/install-cmake-328 | ||
- name: Install cmake 3.28 | ||
run: pip3 install cmake==3.28.4 | ||
|
||
- name: Install VCPKG | ||
# Note: we need to use environment variables instead of workflow variables | ||
# because github messes up path variables when running in container, | ||
# see https://github.com/actions/runner/issues/2058 | ||
run: | | ||
git submodule update --init vcpkg && ./vcpkg/bootstrap-vcpkg.sh -disableMetrics | ||
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV | ||
echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV | ||
echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV | ||
|
||
- name: Restore vcpkg binary dir from cache | ||
id: cache-vcpkg-binary | ||
# Note: we are stuck with v3, because v4 is not compatible with oracle8 image | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: ${{ env.VCPKG_CACHE_DIR }} | ||
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} | ||
# Allows to restore a cache when deps have only partially changed (like adding a dependency) | ||
restore-keys: vcpkg-cache-centos7- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wow! i would recommend to place the "install vcpkg and the restore cache" jobs in dedicated file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately it does not seem so easy, because we cannot have "post actions" in composite github actions :( I wanted to have the 3 steps "install VCPKG", "restore cache" and "save cache" in the same action, but it's not possible. So I'm afraid I will leave it this way for now ... |
||
|
||
- name: Init submodule | ||
run: | | ||
|
@@ -77,20 +98,21 @@ jobs: | |
dnf -y config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo | ||
dnf -y install gh | ||
|
||
|
||
- name: Configure | ||
run: | | ||
source /opt/rh/devtoolset-10/enable | ||
cmake -B _build -S src \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DDEPS_INSTALL_DIR=/rte-antares-deps-Release \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_TESTING=ON \ | ||
-DBUILD_not_system=OFF \ | ||
-DBUILD_TOOLS=ON \ | ||
-DBUILD_UI=OFF \ | ||
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \ | ||
source /opt/rh/devtoolset-10/enable | ||
source /opt/rh/rh-git227/enable | ||
cmake -B _build -S src \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake \ | ||
-DDEPS_INSTALL_DIR=/rte-antares-deps-Release \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_TESTING=ON \ | ||
-DBUILD_not_system=OFF \ | ||
-DBUILD_TOOLS=ON \ | ||
-DBUILD_UI=OFF \ | ||
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \ | ||
|
||
- name: Build | ||
run: | | ||
|
@@ -139,4 +161,10 @@ jobs: | |
run: | | ||
gh release upload "$tag" _build/*.tar.gz _build/*.rpm | ||
|
||
|
||
- name: Cache vcpkg binary dir | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even in the case of build errors ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question :
|
||
if: always() | ||
id: save-cache-vcpkg-binary | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: ${{ env.VCPKG_CACHE_DIR }} | ||
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,8 @@ jobs: | |
env: | ||
ORTOOLS_DIR: ${{ github.workspace }}/or-tools | ||
os: ubuntu-20.04 | ||
# Caching strategy of VCPKG dependencies | ||
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" | ||
|
||
runs-on: ubuntu-20.04 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
|
@@ -45,17 +47,29 @@ jobs: | |
with: | ||
ref: ${{ env.REF }} | ||
|
||
- name: Install VCPKG | ||
run: git submodule update --init vcpkg && ./vcpkg/bootstrap-vcpkg.sh -disableMetrics | ||
|
||
- name: Restore vcpkg binary dir from cache | ||
id: cache-vcpkg-binary | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ github.workspace }}/vcpkg_cache | ||
key: vcpkg-cache-ubuntu-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} | ||
# Allows to restore a cache when deps have only partially changed (like adding a dependency) | ||
restore-keys: vcpkg-cache-ubuntu- | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ env.os }} | ||
|
||
- name: Install libraries | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install uuid-dev libwxgtk3.0-gtk3-dev | ||
sudo apt-get install libboost-test-dev | ||
sudo apt-get install g++-10 gcc-10 | ||
sudo apt-get update | ||
sudo apt-get install uuid-dev libwxgtk3.0-gtk3-dev | ||
sudo apt-get install libboost-test-dev | ||
sudo apt-get install g++-10 gcc-10 | ||
|
||
- name: Read antares-deps version | ||
id: antares-deps-version | ||
|
@@ -95,24 +109,24 @@ jobs: | |
|
||
- name: Configure | ||
run: | | ||
cmake -B _build -S src \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \ | ||
-DDEPS_INSTALL_DIR=${{github.workspace}}/rte-antares-deps-Release \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_TESTING=ON \ | ||
-DBUILD_not_system=OFF \ | ||
-DBUILD_TOOLS=ON \ | ||
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLS_DIR }}/install \ | ||
-DPython3_EXECUTABLE="${{ env.Python3_ROOT_DIR }}/bin/python" | ||
cmake -B _build -S src \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \ | ||
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ | ||
-DDEPS_INSTALL_DIR=${{github.workspace}}/rte-antares-deps-Release \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_TESTING=ON \ | ||
-DBUILD_not_system=OFF \ | ||
-DBUILD_TOOLS=ON \ | ||
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLS_DIR }}/install \ | ||
-DPython3_EXECUTABLE="${{ env.Python3_ROOT_DIR }}/bin/python" | ||
|
||
- name: Build | ||
run: | | ||
cmake --build _build -j$(nproc) | ||
|
||
|
||
# simtest | ||
- name: Read simtest version | ||
id: simtest-version | ||
|
@@ -296,3 +310,11 @@ jobs: | |
tag: ${{ github.event.inputs.release_tag }} | ||
run: | | ||
gh release upload "$tag" _build/*.tar.gz _build/*.deb | ||
|
||
- name: Cache vcpkg binary dir | ||
if: always() | ||
id: save-cache-vcpkg-binary | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ github.workspace }}/vcpkg_cache | ||
key: vcpkg-cache-ubuntu-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a v2 maybe use https://github.com/lukka/run-vcpkg