1+ name : Development Pipeline
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - pq_migration
8+ pull_request :
9+ branches :
10+ - main
11+ - pq_migration
12+
13+ jobs :
14+ install_dependencies :
15+ name : Install Dependencies
16+ runs-on : ubuntu-22.04
17+ steps :
18+ - name : Check out repo
19+ uses : actions/checkout@v3
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v3
23+ with :
24+ python-version : " 3.11.2"
25+
26+ - name : Cache APT packages
27+ id : cache-apt
28+ uses : actions/cache@v3
29+ with :
30+ path : /var/cache/apt
31+ key : ${{ runner.os }}-apt-${{ hashFiles('scripts/setup_pq.sh') }}
32+ restore-keys : |
33+ ${{ runner.os }}-apt-
34+
35+ - name : Update APT and install dependencies
36+ run : |
37+ sudo apt-get update
38+ sudo apt-get install -y libssl-dev cmake
39+
40+ - name : Ensure venv directory exists
41+ run : mkdir -p .venv
42+
43+ - name : Cache venv
44+ id : cache-venv
45+ uses : actions/cache@v3
46+ with :
47+ path : .venv
48+ key : ${{ runner.os }}-venv-${{ hashFiles('requirements.txt') }}
49+ restore-keys : |
50+ ${{ runner.os }}-venv-
51+
52+ - name : Install dependencies
53+ run : |
54+ python -m venv .venv
55+ source .venv/bin/activate
56+ pip install --upgrade pip
57+ pip install -r requirements.txt
58+
59+ - name : Ensure build directory exists
60+ run : mkdir -p build
61+
62+ - name : Cache build artifacts
63+ id : cache-build
64+ uses : actions/cache@v3
65+ with :
66+ path : build/
67+ key : ${{ runner.os }}-build-${{ hashFiles('./scripts/setup_pq.sh') }}
68+ restore-keys : |
69+ ${{ runner.os }}-build-
70+
71+ - name : Make script executable
72+ run : chmod +x ./scripts/setup_pq.sh
73+
74+ - name : Build and install liboqs-python
75+ run : |
76+ git clone --depth=1 https://github.com/open-quantum-safe/liboqs-python
77+ cd liboqs-python
78+ pip install .
79+ cd ..
80+
81+
82+ basics :
83+ name : Code Style Check
84+ runs-on : ubuntu-latest
85+ needs : unit_tests
86+ steps :
87+ - name : Checkout Code
88+ uses : actions/checkout@v3
89+
90+ - name : Set up Python
91+ uses : actions/setup-python@v3
92+ with :
93+ python-version : 3.11.2
94+
95+ - name : Run Ruff
96+ run : ruff check
97+
98+ license_check :
99+ name : License Check
100+ runs-on : ubuntu-latest
101+ steps :
102+ - name : Checkout Code
103+ uses : actions/checkout@v3
104+
105+ - name : Set up Python
106+ uses : actions/setup-python@v3
107+ with :
108+ python-version : 3.11.2
109+
110+ - name : Install Dependencies
111+ run : |
112+ pip install reuse
113+
114+ - name : Run REUSE
115+ run : reuse lint
116+
117+ robot_framework :
118+ name : Robot Framework Code Style
119+ runs-on : ubuntu-latest
120+ needs :
121+ - pylint
122+ - license_check
123+ steps :
124+ - name : Checkout Code
125+ uses : actions/checkout@v3
126+
127+ - name : Set up Python
128+ uses : actions/setup-python@v3
129+ with :
130+ python-version : 3.11.2
131+
132+ - name : Install Robot Framework Robocop
133+ run : pip install robotframework-robocop==5.5.0
134+
135+ - name : Run Robocop
136+ run : robocop --report rules_by_error_type
137+
138+ pylint :
139+ name : Static Analysis with Pylint
140+ runs-on : ubuntu-latest
141+ needs :
142+ - unit_tests
143+ - license_check
144+ steps :
145+ - name : Checkout Code
146+ uses : actions/checkout@v4
147+
148+ - name : Set up Python
149+ uses : actions/setup-python@v4
150+ with :
151+ python-version : 3.11.2
152+
153+ - name : Install Dependencies
154+ run : |
155+ pip install -r requirements-dev.txt
156+
157+ - name : Run Pylint
158+ run : pylint --fail-under=9.70 --disable=W0511 resources
159+
160+ pyright :
161+ name : Static Analysis with Pyright
162+ runs-on : ubuntu-latest
163+ needs :
164+ - install_dependencies
165+ - unit_tests
166+ - license_check
167+ - pylint
168+ steps :
169+ - name : Checkout Code
170+ uses : actions/checkout@v3
171+
172+ - name : Set up Python
173+ uses : actions/setup-python@v3
174+ with :
175+ python-version : 3.11.2
176+
177+ - name : Install Pyright
178+ run : pip install pyright==1.1.389
179+
180+ - name : Run Pyright
181+ run : |
182+ export ERRORS=$(PYTHONPATH=./resources pyright ./resources | tail -n 1 | grep -o '^[0-9]*')
183+ [ -z "$ERRORS" ] && ERRORS=0
184+ [ "$ERRORS" -lt 150 ] 2>/dev/null && echo "Success." || (echo "Failure. Error count:" && exit 1)
0 commit comments