@@ -34,76 +34,24 @@ jobs:
34
34
cpp_centos7 :
35
35
name : Package C++ CentOS7
36
36
runs-on : ubuntu-latest
37
- container : ' centos:centos7'
38
- env :
39
- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
40
37
steps :
41
- - name : Update mirrors
42
- run : |
43
- sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
44
- sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
45
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
46
-
47
- - name : Update Dependencies
48
- run : |
49
- yum update -y
50
-
51
- - name : Install Dependencies 1
52
- run : |
53
- yum install -y epel-release
54
-
55
- - name : Install Dependencies 2
56
- run : |
57
- yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils
58
-
59
- - name : Update mirrors again because why not
60
- run : |
61
- sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
62
- sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
63
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
64
-
65
- - name : Install Dependencies 3
66
- run : |
67
- yum install -y devtoolset-9
68
-
69
- - name : Setup cmake
70
-
71
- with :
72
- cmake-version : ' 3.22.x'
73
-
74
- - name : Checkout sources
75
- uses : actions/checkout@v3
76
-
77
- - name : Download Boost-release
78
- uses : dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
79
- with :
80
- repo : ' ARnDOSrte/Boost'
81
- file : ' boost_1_73_0.zip'
82
- target : ' boost_1_73_0.zip'
83
- token : ${{ secrets.GITHUB_TOKEN }}
84
-
85
- - name : Unzip Boost
86
- run : unzip boost_1_73_0.zip
38
+ - name : Checkout
39
+ uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
87
40
88
- - name : Configure 3rd parties
41
+ - name : Build the Docker image
89
42
run : |
90
- source /opt/rh/devtoolset-9/enable
91
- cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external
43
+ docker build -t centos7withcmake:latest $GITHUB_WORKSPACE --file $GITHUB_WORKSPACE/.github/workflows/docker/Dockerfile
92
44
93
- - name : Build 3rd parties
45
+ - name : Run build steps in Docker container
94
46
run : |
95
- cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2
96
-
97
- - name : Configure CMake
98
- run : |
99
- source /opt/rh/devtoolset-9/enable
100
- cmake -S $GITHUB_WORKSPACE/metrix-simulator -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBoost_ROOT=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DBoost_INCLUDE_DIR=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install -B $GITHUB_WORKSPACE/metrix-simulator/build
101
-
102
- - name : Build
103
- run : cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2
104
-
105
- - name : Tests
106
- run : cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure
47
+ docker run --name build_container -v $GITHUB_WORKSPACE:/workspace centos7withcmake:latest /bin/bash -c "
48
+ source /opt/rh/devtoolset-9/enable &&
49
+ cmake -S /workspace/metrix-simulator/external -B /workspace/metrix-simulator/build/external &&
50
+ cmake --build /workspace/metrix-simulator/build/external --parallel 2 &&
51
+ cmake -S /workspace/metrix-simulator -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBoost_ROOT=/usr/local/src/__w/Boost/Boost/boost_1_73_0/installBoost -DBoost_INCLUDE_DIR=/usr/local/src/__w/Boost/Boost/boost_1_73_0/installBoost -DCMAKE_INSTALL_PREFIX=/workspace/metrix-simulator/build/install -B /workspace/metrix-simulator/build &&
52
+ cmake --build /workspace/metrix-simulator/build --target install --parallel 2 &&
53
+ cd /workspace/metrix-simulator/build && ctest -j2 --output-on-failure
54
+ "
107
55
108
56
- name : Prepare Metrix package
109
57
id : metrix-install
116
64
echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"
117
65
118
66
- name : Upload release package
119
- uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 (nb: v0.1.15)
67
+ uses : softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
120
68
with :
121
69
files : ${{ steps.metrix-install.outputs.archive_path }}.zip
122
70
0 commit comments