-
Notifications
You must be signed in to change notification settings - Fork 22
156 lines (132 loc) · 5.61 KB
/
ci.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
145
146
147
148
149
150
151
152
153
154
155
156
# 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 100 --check discopop_explorer
- name: "Check formatting of DiscoPoP Library"
run: python -m black -l 100 --check discopop_library
- name: "Check formatting of DiscoPoP Profiler"
run: python -m black -l 100 --check discopop_profiler
- name: "Check formatting of DiscoPoP Wizard"
run: python -m black -l 100 --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