-
Notifications
You must be signed in to change notification settings - Fork 11
129 lines (108 loc) · 4.05 KB
/
ubuntu-system-deps-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Ubuntu CI full build
on:
push:
branches:
- ci/*
- dependabot/*
schedule:
- cron: '00 00 * * 0' # Sunday, midnight
jobs:
build:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
os: [ ubuntu-22.04 ]
env:
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
- name: Set-up Xpress with pip for Ubuntu
shell: bash
run: |
python -m pip install "xpress==9.2.7"
echo ${{ env.pythonLocation }}
XPRESS_DIR=${{ env.pythonLocation }}/lib/python${{ env.PYTHON_VERSION }}/site-packages/xpress
echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV
echo "XPAUTH_PATH=$XPRESS_DIR/license/community-xpauth.xpr" >> $GITHUB_ENV
echo "Create symbolic link for XPRESS library file because it is missing in the Python installation"
ln -s $XPRESS_DIR/lib/libxprs.so.42 $XPRESS_DIR/lib/libxprs.so
- name: Install mandatory system libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y g++
- uses: lukka/get-cmake@latest
with:
useLocalCache: false
useCloudCache: true
- name: Read antares-xpansion version
id: antares-xpansion-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_xpansion_version'
- run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
- run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
- name: vcpkg install
run: |
git submodule update --remote --init vcpkg
pushd vcpkg
git fetch --unshallow
./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: Configure
run: |
cmake -B _build -S . \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- 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') }}
- name: Build
run: |
cmake --build _build --config Release -j$(nproc)
cd _build
cmake --install .
- name: Running unit tests
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
cd _build
ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer"
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
with:
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}}
- name: Installer .tar.gz creation
run: |
cd _build
cpack -G TGZ