-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (77 loc) · 2.91 KB
/
centos.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
name: CentOS
on:
push:
branches:
- main
- feature/*
- antares_integration
- fix/*
release:
types: [ created ]
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
build_sirius:
name: build sirius
runs-on: ubuntu-latest
container: 'centos:centos7'
env:
Sirius_Ref: antares_integration
steps:
- name: is release created
run: |
release_created=${{ github.event_name == 'release' && github.event.action == 'created' }}
echo "RELEASE_CREATED=$release_created" >> $GITHUB_ENV
- name: Get release
if: ${{ env.RELEASE_CREATED == 'true' }}
id: get_release
uses:
bruceadams/[email protected]
- name: install requirements
run: |
yum install -y epel-release
yum install -y git redhat-lsb-core centos-release-scl scl-utils
yum install -y cmake3 devtoolset-9
- name: Checkout sirius
run: |
git clone https://github.com/rte-france/sirius-solver -b ${{ env.Sirius_Ref }} .
- name: set sirius output variables
id: sirius-variables
run: |
SIRIUS_BASE_PATH=$PWD
SIRIUS_INSTALL_DIR=centos-7_sirius-solver-install
SIRIUS_INSTALL_PATH="${SIRIUS_BASE_PATH}/${SIRIUS_INSTALL_DIR}"
ARCHIVE_NAME=centos-7_sirius-solver.zip
ARCHIVE_PATH="${SIRIUS_BASE_PATH}/${ARCHIVE_NAME}"
echo "::set-output name=install-dir::$SIRIUS_INSTALL_DIR"
echo "::set-output name=install-path::$SIRIUS_INSTALL_PATH"
echo "::set-output name=archive-name::$ARCHIVE_NAME"
echo "::set-output name=archive-path::$ARCHIVE_PATH"
- name: Configure Sirius
run: |
source /opt/rh/devtoolset-9/enable
cmake3 -S src \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${{ steps.sirius-variables.outputs.install-dir }}"
- name: Build & Install Sirius
run: |
source /opt/rh/devtoolset-9/enable
cmake3 --build build --config Release --target install -j14
- name: Zip Install Sirius
run: |
ARCHIVE_NAME="${{ steps.sirius-variables.outputs.archive-name }}"
zip -r $ARCHIVE_NAME "${{ steps.sirius-variables.outputs.install-dir }}"
- name: Upload sirius install
uses: actions/upload-artifact@v2
with:
name: ${{ steps.sirius-variables.outputs.install-dir }}
path: ${{ steps.sirius-variables.outputs.install-path }}
- name: Publish sirius install
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.sirius-variables.outputs.archive-path }}
asset_name: ${{ steps.sirius-variables.outputs.archive-name }}
asset_content_type: application/zip