@@ -75,80 +75,28 @@ jobs:
75
75
cpp_centos7 :
76
76
name : Build C++ CentOS7
77
77
runs-on : ubuntu-latest
78
- container : ' centos:centos7'
79
- env :
80
- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
81
78
steps :
82
- - name : Update mirrors
83
- run : |
84
- sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
85
- sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
86
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
87
-
88
- - name : Update Dependencies
89
- run : |
90
- yum update -y
91
-
92
- - name : Install Dependencies 1
93
- run : |
94
- yum install -y epel-release
95
-
96
- - name : Install Dependencies 2
97
- run : |
98
- yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils
99
-
100
- - name : Update mirrors again because why not
101
- run : |
102
- sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
103
- sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
104
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
105
-
106
- - name : Install Dependencies 3
107
- run : |
108
- yum install -y devtoolset-9
109
-
110
- - name : Setup cmake
111
-
112
- with :
113
- cmake-version : ' 3.22.x'
114
-
115
- - name : Checkout sources
116
- uses : actions/checkout@v3
117
-
118
- - name : Download Boost-release
119
- uses : dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
120
- with :
121
- repo : ' ARnDOSrte/Boost'
122
- file : ' boost_1_73_0.zip'
123
- target : ' boost_1_73_0.zip'
124
- token : ${{ secrets.GITHUB_TOKEN }}
125
-
126
- - name : Unzip Boost
127
- run : unzip boost_1_73_0.zip
128
-
129
- - name : Configure 3rd parties
130
- run : |
131
- source /opt/rh/devtoolset-9/enable
132
- cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external
79
+ - name : Checkout
80
+ uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
133
81
134
- - name : Build 3rd parties
82
+ - name : Build the Docker image
135
83
run : |
136
- cmake -- build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2
84
+ docker build -t centos7withcmake:latest $GITHUB_WORKSPACE --file $GITHUB_WORKSPACE/.github/workflows/docker/Dockerfile
137
85
138
- - name : Configure CMake
86
+ - name : Run build steps in Docker container
139
87
run : |
140
- source /opt/rh/devtoolset-9/enable
141
- 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
142
-
143
- - name : Build
144
- run : cmake --build $GITHUB_WORKSPACE/ metrix-simulator/build --target install --parallel 2
145
-
146
- - name : Tests
147
- run : cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure
88
+ docker run --name build_container -v $GITHUB_WORKSPACE:/workspace centos7withcmake:latest /bin/bash -c "
89
+ source /opt/rh/devtoolset-9/enable &&
90
+ cmake -S /workspace/metrix-simulator/external -B /workspace/metrix-simulator/build/external &&
91
+ cmake --build /workspace/metrix-simulator/build/external --parallel 2 &&
92
+ 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 &&
93
+ cmake --build /workspace/metrix-simulator/build --target install --parallel 2 &&
94
+ cd /workspace/metrix-simulator/build && ctest -j2 --output-on-failure
95
+ "
148
96
149
97
- name : Upload Metrix Simulator archive
150
98
if : ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }}
151
- uses : actions/upload-artifact@v3
99
+ uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3
152
100
with :
153
101
name : metrix-simulator-centos7
154
102
path : |
0 commit comments