Merge branch 'main' of github.com:wrench-project/wrench-python-api #195
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "github-actions@github.com" | |
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 |