-
Notifications
You must be signed in to change notification settings - Fork 25
194 lines (179 loc) · 7.62 KB
/
Copy pathmain.yml
File metadata and controls
194 lines (179 loc) · 7.62 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# This is a basic workflow to help you get started with Actions
# workflow - цепочка действий
# Имя процесса Билдится на всех типах 📦 🐍
name: CMake Build Matrix
# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }} # будет запускаться по очереди на всех типах машин
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
config:
- {
name: "Ubuntu_Latest_GCC",
os: ubuntu-22.04,
artifact: "ubuntu_gcc.7z",
build_type: "Debug",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja"
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
echo login usera: ${{github.actor}}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ninja cmake
ninja --version
cmake --version
# cmd "${{ matrix.config.environment_script }}"
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'Ubuntu_Latest_GCC')
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake
ninja --version
cmake --version
gcc --version
sudo apt-get install libgtest-dev libgmock-dev
sudo apt-get install libtbb-dev
- name: Install dependencies on ubuntu12
if: startsWith(matrix.config.name, 'Ubuntu_GCC_12')
run: |
echo Update gcc-12 =======================================================================
echo gcc version before
gcc --version
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install ninja-build cmake gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
echo gcc version after
gcc --version
echo Update ninja =======================================================================
echo ninja version before
ninja --version
wget https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip
sudo unzip ninja-linux.zip -d /usr/local/bin/
sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force
echo ninja version after
ninja --version
echo Update cmake ========================================================================
echo cmake version before
cmake --version
cmake_version=$(curl --silent "https://api.github.com/repos/Kitware/CMake/releases/latest" | sed -n 's/.*tag_name":\s"\(.*\)".*/\1/p' | head -2 | cut -c 2-)
echo cmake download latest v$cmake_version version
wget https://github.com/Kitware/CMake/releases/download/v$cmake_version/cmake-$cmake_version-Linux-x86_64.sh
chmod +x cmake-$cmake_version-Linux-x86_64.sh
sudo mkdir /opt/cmake
sudo ./cmake-$cmake_version-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
sudo update-alternatives --install /usr/bin/cmake cmake /opt/cmake/bin/cmake 1 --force
echo cmake version after
cmake --version
echo Install google test lib ========================================================================
sudo apt-get install libgtest-dev libgmock-dev
sudo apt-get install libtbb-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install gspread
shell: bash
run: pip install gspread
- name: See test ls
if: always()
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear
run: |
ls
gcc 12 --version
- name: Very hard setting load json
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear
run: |
pip install pandas
pip install gdown
gdown 1L6dRqWVmXx5V16C0sQXFQUK43PBfJ4hX
- name: Load magscr, tstscr, mag
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear
run: |
gdown 1VLNuCVgDOw6PMqHMIsBl5xoYjYmPbCEK
gdown 1qFuKKr6acDVp3JMEy1VaIqIgsfpAA2xD
gdown 129gQ_wu82M4eud8mgmp8_C4jwA5TqRKa
ls
- name: 0-Begin_Task
if: always()
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear/BeginTask-0
run: |
mkdir build
mkdir instdir
cmake --no-warn-unused-cli -D CMAKE_C_COMPILER=gcc-12 -D CMAKE_CXX_COMPILER=g++-12 -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -B ./build -G Ninja
cmake --build ./build --config ${{ matrix.config.build_type }}
gdown 1h8WuhuSvkxJrDyyXZPokyp0w-a3o5Jka
gdown 16hhW-MiiHFEKbhKzwli2twAVJjHuGNHg
ls
cd build
./main --gtest_output=json:../report.json
- name: 0-Begin_Task_Test
if: always()
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear/BeginTask-0
run: |
ls
python3 testscript.py -p ${{github.actor}}
- name: 2-BitField
if: always()
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear/BitField-2
run: |
mkdir build
mkdir instdir
cmake --no-warn-unused-cli -D CMAKE_C_COMPILER=gcc-12 -D CMAKE_CXX_COMPILER=g++-12 -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -B ./build -G Ninja
cmake --build ./build --config ${{ matrix.config.build_type }}
gdown 1h8WuhuSvkxJrDyyXZPokyp0w-a3o5Jka
gdown 16hhW-MiiHFEKbhKzwli2twAVJjHuGNHg
ls
cd build
./main --gtest_output=json:../report.json
- name: 2-BitField_Test
if: always()
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear/BitField-2
run: |
ls
python3 testscript.py -p ${{github.actor}}
- name: Estimate
if: always()
shell: bash
working-directory: /home/runner/work/SecondYear/SecondYear
run: python3 testscript.py -p ${{github.actor}}
- name: Upload release asset
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ matrix.config.artifact }}
asset_name: ${{ matrix.config.artifact }}.zip
asset_content_type: application/zip