-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·144 lines (142 loc) · 5.03 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
140
141
142
143
144
name: Build
on:
push:
branches:
- main
paths-ignore:
- '**.md'
jobs:
run-tests-and-examples:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.11 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install wrench-daemon
run: |
# WITHOUT DOCKER
#cd /tmp/
#pip install jsonref
#sudo apt-get update
#sudo apt-get -y install gcc
#sudo apt-get -y install libasio-dev
#sudo apt-get -y install libboost-all-dev
#wget https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.tar.gz
#tar -xf v3.10.5.tar.gz
#cd json-3.10.5
#cmake .
#make -j4
#sudo make install
#cd ..
#wget --no-check-certificate https://framagit.org/simgrid/simgrid/-/archive/v3.36/simgrid-v3.36.tar.gz
#tar -xf simgrid-v3.36.tar.gz
#cd simgrid-v3.36
#cmake -Denable_documentation=OFF .
#make -j4
#sudo make install
#cd ..
#git clone https://github.com/wrench-project/wrench.git
#cd wrench
#cmake .
#make -j4 wrench-daemon
#sudo make install
#cd ..
#cd
# END WITHOUT DOCKER
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
docker pull wrenchproject/wrench:unstable
- name: Start wrench-daemon
run: |
# WITHOUT DOCKER
#export LD_LIBRARY_PATH=/usr/local/lib/
#wrench-daemon &
#echo "PID=$!" >> $GITHUB_ENV
# END WITHOUT DOCKER
docker run --name wrench-daemon-container -v `pwd`:/home/wrench wrenchproject/wrench:unstable wrench-daemon &
- name: Install the wrench Python API
run: |
# WIThOUT DOCKER
#pip install .
# END WITHOUT DOCKER
docker exec --workdir /home/wrench/ wrench-daemon-container sudo pip install .
- name: Run all tests
run: |
# WITHOUT DOCKER
#cd tests
#bash ./run_all_tests.sh
#cd ..
# END WITHOUT DOCKER
docker exec --workdir /home/wrench/tests wrench-daemon-container bash ./run_all_tests.sh
- name: Run all examples
run: |
# WITHOUT DOCKER
#cd examples
#bash ./run_all_examples.sh
#cd ..
# END WITHOUT DOCKER
docker exec --workdir /home/wrench/examples wrench-daemon-container bash ./run_all_examples.sh
- name: Compute coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# WITHOUT DOCKER
#pip install coverage
#bash ./.compute_coverage.sh
# END WITHOUT DOCKER
docker exec wrench-daemon-container sudo pip install coverage
COVERAGE_PERCENTAGE=$(docker exec --workdir /home/wrench/ wrench-daemon-container bash ./.compute_coverage.sh)
echo "COVERAGE_PERCENTAGE: $COVERAGE_PERCENTAGE"
badge_url="https://img.shields.io/badge/Coverage-${COVERAGE_PERCENTAGE}25-brightgreen"
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} repo
cd repo;
tail README.md
head -n -1 README.md > README_tmp.md
echo "[coverage-badge]: ${badge_url}" >> README_tmp.md
mv README_tmp.md README.md
tail README.md
if git diff --quiet; then
echo "No changes detected in README.md. Skipping commit and push."
exit 0
fi
git config user.name "github-actions"
git config user.email "[email protected]"
git add README.md
git commit -m "Update coverage badge URL in README"
git push origin main
- name: Kill wrench-daemon
run: |
# WITHOUT DOCKER
#kill ${{ env.PID }} || true
# END WITHOUT DOCKER
docker kill wrench-daemon-container
build-documentation:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.11 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y python3-sphinx sphinx-rtd-theme-common
pip install sphinx-rtd-theme
pip install sphinx_rtd_theme recommonmark
- name: Check package install
run: |
pip install .
- name: Build documentation
run: |
cd docs
make html