Feat/patch management #3465
Workflow file for this run
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
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de) | |
# | |
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany | |
# | |
# This software may be modified and distributed under the terms of | |
# the 3-Clause BSD License. See the LICENSE file in the package base | |
# directory for details. | |
name: "DiscoPoP CI" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- '**' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
execute_tests: | |
runs-on: ubuntu-20.04 | |
name: Execute CI Tests | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: "Check all files for DiscoPoP License tag" | |
run: ./scripts/dev/check-license.sh $(find . -type f) | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: 'pip' # uses requirements.txt | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
- name: "Run MyPy Type Checker - DiscoPoP Explorer" | |
run: python -m mypy --config-file=mypy.ini -p discopop_explorer | |
- name: "Run MyPy Type Checker - DiscoPoP Library" | |
run: python -m mypy --config-file=mypy.ini -p discopop_library | |
- name: "Run MyPy Type Checker - DiscoPoP Profiler" | |
run: python -m mypy --config-file=mypy.ini -p discopop_profiler | |
- name: "Run MyPy Type Checker - DiscoPoP Wizard" | |
run: python -m mypy --config-file=mypy.ini -p discopop_wizard | |
- name: "Check formatting of DiscoPoP Explorer" | |
run: python -m black -l 120 --check discopop_explorer | |
- name: "Check formatting of DiscoPoP Library" | |
run: python -m black -l 120 --check discopop_library | |
- name: "Check formatting of DiscoPoP Profiler" | |
run: python -m black -l 120 --check discopop_profiler | |
- name: "Check formatting of DiscoPoP Wizard" | |
run: python -m black -l 120 --check discopop_wizard | |
- name: Test DiscoPop Explorer - DISABLED | |
run: | | |
if false; then # disable the check temporarily | |
TARGETS="mergesort reduction simple_pipeline" | |
PATTERNS="do_all reduction" | |
for target in $TARGETS; do | |
echo "checking target: ${target}" | |
python -m discopop_explorer --path=test/${target}/data --json=test/${target}/data/result_${target}.json | |
# count different suggestions and check against test data | |
for pattern in $PATTERNS; do | |
echo "checking pattern: ${pattern}" | |
ACTUAL=$(echo "$(cat test/${target}/data/result_${target}.json | python3 -c "import sys, json; print(json.load(sys.stdin)['${pattern}'])" | grep -c "node_id")") | |
EXPECTED=$(echo "$(cat test/${target}.json | python3 -c "import sys, json; print(json.load(sys.stdin)['${pattern}'])" | grep -c "node_id")") | |
if [ "$ACTUAL" != "$EXPECTED" ]; then | |
echo "::error:: ${pattern}: Amount of mentioned node ids in identified suggestions not equal! Expected: $EXPECTED, Actual: ${ACTUAL}" | |
exit 1 | |
fi | |
done | |
echo "" | |
done | |
fi | |
- name: Setup DiscoPoP Profiler - Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get remove clang-8 clang-9 clang-10 clang-11 clang-12 | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" | |
sudo apt-get update | |
sudo apt-get install -y cmake libclang-11-dev clang-11 llvm-11 | |
sudo ln -s /usr/bin/clang-11 /usr/bin/clang || true | |
sudo ln -s /usr/bin/clang++-11 /usr/bin/clang++ || true | |
sudo ln -s /usr/bin/llvm-link-11 /usr/bin/llvm-link || true | |
sudo ln -s /usr/bin/opt-11 /usr/bin/opt || true | |
sudo apt-get install -y python3-tk | |
- name: "Setup DiscoPoP Profiler - Build" | |
run: | | |
rm -rf build | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Debug .. | |
make -j3 | |
- name: Python Unit-tests | |
run: python -m unittest -v | |
- name: "Setup DiscoPoP Profiler - Create executable" | |
run: chmod +x .github/workflows/tests/profiler.sh | |
- name: "Execute DiscoPoP Profiler - mergesort - discopopPass" | |
run: .github/workflows/tests/profiler.sh mergesort discopopPass | |
- name: "Execute DiscoPoP Profiler - reduction - discopopPass" | |
run: .github/workflows/tests/profiler.sh reduction discopopPass | |
- name: "Execute DiscoPoP Profiler - simple_pipeline - discopopPass" | |
run: .github/workflows/tests/profiler.sh simple_pipeline discopopPass | |
update_wiki-build: | |
name: "Update Wiki - Build" | |
runs-on: ubuntu-20.04 | |
needs: execute_tests | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./docs/ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
update_wiki-deploy: | |
name: "Update Wiki - Deploy" | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-20.04 | |
needs: update_wiki-build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |