-
Notifications
You must be signed in to change notification settings - Fork 22
139 lines (118 loc) · 4.39 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
# 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_code_checks:
runs-on: ubuntu-20.04
name: Execute Code Checks
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 - DEPRECATED"
run: python -m mypy --config-file=mypy.ini -p DEPRECATED_discopop_profiler
- name: "Run MyPy Type Checker - DiscoPoP Wizard - DEPRECATED"
run: python -m mypy --config-file=mypy.ini -p DEPRECATED_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 - DEPRECATED"
run: python -m black -l 120 --check DEPRECATED_discopop_profiler
- name: "Check formatting of DiscoPoP Wizard - DEPRECATED"
run: python -m black -l 120 --check DEPRECATED_discopop_wizard
execute_unit_tests:
runs-on: ubuntu-20.04
name: Execute Unit Tests
needs: execute_code_checks
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- 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: 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
update_wiki-build:
name: "Update Wiki - Build"
runs-on: ubuntu-20.04
needs: execute_code_checks
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