| 1 |
|
| 2 |
|
| 3 |
name: CI python3 FreeBSD |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
on: |
| 8 |
push: |
| 9 |
branches: [ python3 ] |
| 10 |
pull_request: |
| 11 |
branches: [ python3 ] |
| 12 |
workflow_dispatch: |
| 13 |
schedule: |
| 14 |
- cron: '37 15 * * 5' |
| 15 |
|
| 16 |
|
| 17 |
jobs: |
| 18 |
|
| 19 |
test: |
| 20 |
|
| 21 |
runs-on: ubuntu-latest |
| 22 |
|
| 23 |
strategy: |
| 24 |
matrix: |
| 25 |
freebsd-release: [ '13.4', '13.5', '14.2', '14.3', '15.0' ] |
| 26 |
|
| 27 |
|
| 28 |
steps: |
| 29 |
|
| 30 |
- uses: actions/checkout@v4 |
| 31 |
|
| 32 |
- name: Test in FreeBSD |
| 33 |
uses: vmactions/freebsd-vm@v1 |
| 34 |
with: |
| 35 |
release: ${{ matrix.freebsd-release }} |
| 36 |
usesh: true |
| 37 |
prepare: pkg install -y python3 devel/py-pip coreutils cksfv git-tiny rust |
| 38 |
run: | |
| 39 |
set -ex |
| 40 |
|
| 41 |
pwd |
| 42 |
ls -lah |
| 43 |
whoami |
| 44 |
env |
| 45 |
freebsd-version |
| 46 |
|
| 47 |
ln -s /usr/local/bin/python3 /usr/local/bin/python |
| 48 |
ln -s /usr/local/bin/gmd5sum /usr/local/bin/md5sum |
| 49 |
ln -s /usr/local/bin/gsha1sum /usr/local/bin/sha1sum |
| 50 |
ln -s /usr/local/bin/gsha224sum /usr/local/bin/sha224sum |
| 51 |
ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum |
| 52 |
ln -s /usr/local/bin/gsha384sum /usr/local/bin/sha384sum |
| 53 |
ln -s /usr/local/bin/gsha512sum /usr/local/bin/sha512sum |
| 54 |
|
| 55 |
pw groupadd docker -g 127 |
| 56 |
pw useradd runner -u 1001 -g docker |
| 57 |
|
| 58 |
# Install test dependencies |
| 59 |
pip install pyroma |
| 60 |
pip install check-manifest |
| 61 |
pip install twine |
| 62 |
pip install wheel |
| 63 |
pip install flake8 |
| 64 |
pip install build |
| 65 |
pip list |
| 66 |
|
| 67 |
# Check syntax by compiling code |
| 68 |
python -W error -bb -m compileall -f . |
| 69 |
|
| 70 |
# Run unit tests |
| 71 |
su runner -c 'python -W error -bb test/test.py --unit --exit-early' |
| 72 |
|
| 73 |
# Run integration tests (internal) |
| 74 |
su runner -c 'ulimit -n; ulimit -n 4096; python -W error -bb test/test.py -i --exit-early' |
| 75 |
|
| 76 |
# Run integration tests (external process) |
| 77 |
su runner -c 'ulimit -n; ulimit -n 4096; test/test.py -e --exit-early' |
| 78 |
|
| 79 |
# Check package quality |
| 80 |
su runner -c 'pyroma -n 10 .' |
| 81 |
|
| 82 |
# Check the completeness of MANIFEST.in |
| 83 |
su runner -c 'check-manifest .' |
| 84 |
|
| 85 |
# Run flake |
| 86 |
flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics . |
| 87 |
|
| 88 |
# Check distribution |
| 89 |
python -m build |
| 90 |
twine check dist/* |