-
-
Notifications
You must be signed in to change notification settings - Fork 37
155 lines (128 loc) · 4.04 KB
/
integration.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
---
name: Integration
on: [push, pull_request]
jobs:
python_test:
name: Run against Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CLICOLOR_FORCE: 1
strategy:
fail-fast: false
matrix:
os:
- 'macOS-latest'
- 'ubuntu-latest'
python-version:
# - '3.7'
# - '3.8'
- '3.9'
# - '3.10'
- '3.11'
- '3.12-dev'
- 'pypy3.9'
include:
- os: 'ubuntu-20.04'
python-version: '3.6'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install required dependencies for standalone builds
run: |
sudo apt update && sudo apt install -y patchelf
python -m pip install --upgrade pip setuptools
pip install nuitka pex stickytape pyinstaller
- name: Install module regularly
run: pip install .
- name: Simple module executions
run: |
time archey
time python -m archey
- name: Run our test suite
run: python -m unittest
# Currently disabled against Python 3.12.
- name: Standalone building (with Nuitka)
if: ${{ matrix.python-version != '3.12-dev' }}
run: |
python -m nuitka \
--onefile \
--include-package=archey.logos \
--output-filename=archey \
--output-dir=dist \
--quiet \
archey/__main__.py
time ./dist/archey
rm dist/archey
# Currently disabled against Python 3.12.
- name: Standalone building (with PEX)
if: ${{ matrix.python-version != '3.12-dev' }}
run: |
pex \
-o dist/archey \
-m archey \
.
time ./dist/archey
rm dist/archey
- name: Standalone building (with Stickytape)
run: |
stickytape \
--copy-shebang \
--add-python-path . \
--output-file dist/archey \
--add-python-module archey.logos."$(python -c 'import distro; print(distro.id())')" \
archey/__main__.py
chmod +x dist/archey
time ./dist/archey
rm dist/archey
# Disabled against PyPy (see <https://stackoverflow.com/a/22245203>).
# Currently disabled against Python 3.12.
- name: Standalone building (with PyInstaller)
if: ${{ matrix.python-version != 'pypy3.9' && matrix.python-version != '3.12-dev' }}
run: |
pyinstaller \
--distpath dist \
--specpath dist \
--name archey \
--onefile archey/__main__.py \
--hidden-import archey.logos."$(python -c 'import distro; print(distro.id())')" \
--log-level WARN
time ./dist/archey
rm dist/archey
python_lint:
name: Lint Python sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install lint tools and project (for its dependencies)
run: |
python -m pip install --upgrade pip
pip install pylint pylint-secure-coding-standard mypy black isort
pip install .
- name: Lint sources against Pylint
run: pylint archey/
- name: Lint sources against Mypy
run: mypy archey/
- name: Run isort
run: isort --check --diff archey/
- name: Run Black
run: black --check --diff archey/
shell:
name: Lint packaging shell scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: shellcheck packaging/*
man:
name: Lint manual page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt update && sudo apt install -y groff
- run: |
groff -man -Tascii -z archey.1 2&>1 | tee errors
test ! -s errors