-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (98 loc) · 3.42 KB
/
Copy pathcmake-single-platform.yml
File metadata and controls
124 lines (98 loc) · 3.42 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
name: Build and run project
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]
env:
EXECUTABLE_NAME: nons
TEST_EXECUTABLE_NAME: test_nons
METRICS_ARTIFACT_DIR: metrics
OLD_METRICS_ARTIFACT_DIR: metrics/old
NEW_METRICS_ARTIFACT_DIR: metrics/new
jobs:
clang-format:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Clang Format
run: |
python3 -m venv venv
./venv/bin/pip install "clang-format==19.1.3"
- name: Check Clang format
run: |
./venv/bin/clang-format --version
./venv/bin/clang-format --dry-run -Werror $(git ls-files 'source/*.cpp' 'source/*.hpp' 'test/*.cpp' 'test/*.hpp')
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Configure CMake for building project
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROJECT=ON -DBUILD_TESTS=OFF
- name: Build project
run: cmake --build build --config Debug -j $(nproc)
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: build/**
run-simulations:
runs-on: ubuntu-24.04
needs: build
permissions:
contents: write
steps:
- name: Apt update
run: sudo apt update
- name: Install dependencies
run: |
sudo apt install --fix-missing gnuplot
sudo apt install --fix-missing graphviz
pip install graphviz
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-artifact
- name: Add executable flag
run: chmod +x ${{env.EXECUTABLE_NAME}}
- name: Run new simulations
run: python3 scripts/run_new_simulations.py -e ./${{env.EXECUTABLE_NAME}} --no-logs -c configs/scenario-configs.txt --output-dir ./${{env.NEW_METRICS_ARTIFACT_DIR}}
- name: Create html
run: python3 scripts/generate-html.py ./${{env.METRICS_ARTIFACT_DIR}}
- name: Upload metrics
uses: actions/upload-artifact@v4
with:
name: metrics
path: ${{env.METRICS_ARTIFACT_DIR}}/**
- name: Put github context to json file
run: echo '${{ toJson(github) }}' > github_context.json
- name: Calculate deploy destination dir
run: |
DEPLOY_DIR=$(python3 scripts/calculate_deploy_dir.py -c github_context.json);
echo "DEPLOY_DIR=${DEPLOY_DIR}/${{env.METRICS_ARTIFACT_DIR}}" >> $GITHUB_ENV;
- name: Deploy to GitHub Pages
if: ${{env.DEPLOY_DIR}} != ''
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{env.METRICS_ARTIFACT_DIR}}
destination_dir: ${{env.DEPLOY_DIR}}
- name: Wait for artifacts to be available
run:
python3 scripts/check_artifacts.py -u 'https://cloud-storage-team.github.io/algnet/${{env.DEPLOY_DIR}}'
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Configure CMake for building tests
run: cmake -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_PROJECT=OFF -DBUILD_TESTS=ON
- name: Build tests
run: cmake --build build --config Debug -j $(nproc)
- name: Run tests
working-directory: build
run: ./${{env.TEST_EXECUTABLE_NAME}}