-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·139 lines (127 loc) · 4.57 KB
/
build.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
name: Build-Linux
on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
- '**.rst'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: bw-outputs
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Install prereqs
run: |
sudo apt-get update
sudo apt-get install -y libgraphviz-dev libboost-all-dev
- name: Install SimGrid
run: |
git clone https://framagit.org/simgrid/simgrid.git
cd simgrid
mkdir build
cd build
cmake -Denable_smpi=OFF -Denable_model-checking=OFF ..
make -j4
sudo make install
- name: Install Google Tests
run: |
wget https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz
tar xf release-1.11.0.tar.gz
cd googletest-release-1.11.0
cmake .
make -j4
sudo make install
- name: Install lcov and gcovr
run: |
sudo apt-get -y install lcov gcovr
- name: Run tests, compute coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
git clone https://github.com/frs69wq/file-system-module.git
cd file-system-module
mkdir build
cd build
cmake ..
make -j4
sudo make install
make -j4 unit_tests examples
./unit_tests
./examples/open_seek_write
./examples/jbod
lcov --directory . --directory examples/ --capture --output-file coverage.info
lcov --remove coverage.info '*/test/*' '*/examples/*' '*/include/*'
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_TOKEN}
# with:
#token: ${{ secrets.CODECOV_TOKEN }}
#verbose: true
# directory: ./coverage/reports/
# env_vars: OS,PYTHON
# fail_ci_if_error: true
# files: ./coverage1.xml,./coverage2.xml,!./cache
# flags: unit_tests
# name: codecov-umbrella
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Run build-wrapper
run: |
mkdir build
cmake -S . -B build
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
- name: Run tests to generate coverage statistics
run: |
cd build
make -j4 unit_tests examples
./unit_tests
./examples/open_seek_write
./examples/jbod
- name: Collect coverage into one XML report
run: |
gcovr -e test -e examples --sonarqube -u -o coverage.xml --exclude-throw-branches \
--gcov-ignore-parse-errors --exclude-unreachable-branches
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" \
--define sonar.coverageReportPaths=coverage.xml
- name: Install Doxygen and Sphinx
run: |
sudo apt-get -y install doxygen
sudo apt-get -y install python3-sphinx
pip install sphinx_rtd_theme
pip install recommonmark
pip install breathe
pip install defusedxml
- name: Build and Deploy Documentation
env:
TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }}
run: |
#git clone https://github.com/frs69wq/file-system-module.git
echo "Building documentation..."
cd file-system-module/build
pwd
cmake ..
make doc
mkdir $HOME/gh-pages-to-deploy
cp -r ./docs/latest/* $HOME/gh-pages-to-deploy/
cd ../..
echo "Updating gh-pages branch..."
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git clone --quiet --branch=gh-pages https://${TOKEN_GITHUB}@github.com/henricasanova/file-system-module.git gh-pages > /dev/null
cd gh-pages
cp -Rf $HOME/gh-pages-to-deploy/* .
touch .nojekyll
git add -f .
git diff-index --quiet HEAD || git commit -m "GitHub build $GITHUB_RUN_NUMBER"
git push -fq origin gh-pages > /dev/null
echo "Done updating gh-pages!"