-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (123 loc) · 4.17 KB
/
cmake-single-platform.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
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
name: CMake on a single platform
on:
push:
branches: [ "master" ]
paths:
- 'CMakeLists.txt'
- 'src/**'
- 'tests/**'
- 'include/**'
- '.github/workflows/*.yml'
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check version
run: cmake --version && g++ --version
- name: Configure CMake
working-directory: ${{github.workspace}}/tests
run: cmake -S . -B build
- name: Build
working-directory: ${{github.workspace}}/tests
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/tests/build
run: ctest -C ${{env.BUILD_TYPE}} -V
run-graph:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure CMake
working-directory: ${{github.workspace}}
run: cmake -S . -B build
- name: Build
working-directory: ${{github.workspace}}
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Directory
working-directory: ${{github.workspace}}/build
run: mkdir graph-results
- name: Run little_n_little_p
working-directory: ${{github.workspace}}/build
run: ./ggraph -n 100 -p 0.03 -o graph-results/little_n_little_p.gml
- name: Run middle_n_middle_p
working-directory: ${{github.workspace}}/build
run: ./ggraph -n 500 -p 0.01 -o graph-results/middle_n_middle_p.gml
- name: Run little_n_big_p
working-directory: ${{github.workspace}}/build
run: ./ggraph -n 100 -p 0.3 -o graph-results/little_n_big_p.gml
- name: Run big_n_little_p
working-directory: ${{github.workspace}}/build
run: ./ggraph -n 1000 -p 0.001 -o graph-results/big_n_little_p.gml
- name: Run big_n_big_p
working-directory: ${{github.workspace}}/build
run: ./ggraph -n 1000 -p 0.3 -o graph-results/big_n_big_p.gml
- name: Run middle_n_middle_p
working-directory: ${{github.workspace}}/build
run: ./ggraph -n 500 -p 0.01 -o graph-results/middle_n_middle_p.gml
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: graph-results
path: ${{github.workspace}}/build/graph-results/
upload:
needs: [run-graph]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Go to result branch
run: |
git checkout result
git pull
- name: Download
uses: actions/download-artifact@v3.0.2
with:
name: graph-results
path: ${{github.workspace}}
- name: Commit file
working-directory: ${{github.workspace}}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -a -m "Results"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: result
force: true
bfs-algo:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure CMake
working-directory: ${{github.workspace}}
run: cmake -S . -B build
- name: Build
working-directory: ${{github.workspace}}
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: run bfs
working-directory: ${{github.workspace}}/build
run: ./ggraph -algo bfs -n 10000 -p 0.002
dfs-algo:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure CMake
working-directory: ${{github.workspace}}
run: cmake -S . -B build
- name: Build
working-directory: ${{github.workspace}}
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: run dfs
working-directory: ${{github.workspace}}/build
run: ./ggraph -algo dfs -n 10000 -p 0.002