-
Notifications
You must be signed in to change notification settings - Fork 18
62 lines (47 loc) · 2.21 KB
/
code-quality.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
name: Test code quality
on: push
jobs:
code-quality-python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
- name: Install required system packages only for Ubuntu Linux
run: |
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y python3 python3-pip python3-aiohttp python3-msgpack python3-aiodns python3-alembic python3-sqlalchemy python3-setproctitle redis python3-aioredis python3-psutil sudo acl curl systemd-container squashfs-tools debootstrap python3-packaging python3-cpuinfo python3-nftables python3-jsonschema
pip install --upgrade typing-extensions types-PyYAML
- name: Install required Python packages
run: |
python3 -m pip install mypy pytest black isort flake8
- name: Test with Black
run: |
black --check ./vm_supervisor
black --check ./runtimes/aleph-debian-11-python/init1.py
- name: Test with isort
run: |
isort --check-only --profile=black ./vm_supervisor
isort --check-only --profile=black ./runtimes/aleph-debian-11-python/init1.py
- name: Test with MyPy
run: |
mypy --ignore-missing-imports ./vm_supervisor
mypy --ignore-missing-imports ./runtimes/aleph-debian-11-python/init1.py
- name: Test with flake8
run: |
flake8 --extend-ignore E501 ./vm_supervisor
flake8 --extend-ignore E501,E402 ./runtimes/aleph-debian-11-python/init1.py
code-quality-shell:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
- name: Install required system packages only for Ubuntu Linux
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Run Shellcheck on all shell scripts
run: |
find ./ -type f -name "*.sh" -exec shellcheck {} \;