-
Notifications
You must be signed in to change notification settings - Fork 24
127 lines (105 loc) · 3.47 KB
/
centos7.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
name: Centos7 CI (push and/or release)
on:
release:
types: [created]
push:
branches:
- develop
- feature/*
- features/*
- fix/*
- issue-*
- release/*
- doc/*
env:
GITHUB_TOKEN: ${{ github.token }}
IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }}
IS_PUSH: ${{ github.event_name == 'push' }}
jobs:
build:
name: Build
env:
ORTOOLSDIR: ${{ github.workspace }}/or-tools
runs-on: ubuntu-latest
container: 'antaresrte/rte-antares:centos7-simulator-no-deps'
steps:
- name: Checkout
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME .
- name: Init submodule
run: |
git submodule update --init --recursive src/antares-deps src/tests/resources/Antares_Simulator_Tests
- name: Download & extract precompiled deps at root
run: |
ANTARES_DEPS_VERSION=$(cut -d'"' -f4 antares-deps-version.json | grep -Ev '\{|\}')
cd /
wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${ANTARES_DEPS_VERSION}/rte-antares-deps-centos7-Release.tar.gz
tar -xvf rte-antares-deps-centos7-Release.tar.gz
rm -rf rte-antares-deps-centos7-Release.tar.gz
- name: Config OR-Tools URL
run: |
echo "URL_ORTOOLS=https://github.com/rte-france/or-tools/releases/download/v9.5-rte2.0/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV
- name: Download OR-Tools
id: ortools
run: |
mkdir -p ${{ env.ORTOOLSDIR }} && cd ${{ env.ORTOOLSDIR }}
wget -q -O ortools.zip ${{ env.URL_ORTOOLS }}
unzip -q ortools.zip
rm ortools.zip
- name: Configure
run: |
source /opt/rh/devtoolset-9/enable
cmake3 -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 \
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \
- name: Build
run: |
source /opt/rh/devtoolset-9/enable
source /opt/rh/rh-git227/enable
cmake3 --build _build --config Release -j2
ccache -s
- name: Installer .rpm creation
run: |
cd _build
cpack3 -G RPM
- name: Solver archive creation
run: |
cd _build
cmake3 --install . --prefix install
pushd .
cd install/bin
tar czf ../../antares-solver_centos7.tar.gz antares-*-solver libsirius_solver.so
popd
rm -rf install
- name: .tar.gz creation
run: |
cd _build
cpack3 -G TGZ
- name: Installer TGZ push
uses: actions/upload-artifact@v3
with:
path: _build/*.tar.gz
- name: Installer RPM push
uses: actions/upload-artifact@v3
with:
path: _build/*.rpm
publish_assets:
name: Publish assets
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
if: ${{ env.IS_RELEASE == 'true' }}
uses: actions/download-artifact@v3
- 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"]'