Merge branch 'mohr' into 'master' #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: unittest_pytest_coverage_doc | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
pep8_check: | |
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: apt-get update | |
run: sudo apt-get update | |
- name: install dependencies for PEP 8 code style check (ubuntu packages) | |
run: sudo apt-get install pep8 python3-pytest | |
- name: check PEP 8 code style | |
run: pep8 --show-source --show-pep8 --statistics $(find -name "*.py") | |
- name: install pylint | |
run: pip install pylint | |
- name: run pylint | |
run: | | |
pylint --version | |
pylint --jobs 0 --persistent n --recursive y --disable similarities . | |
echo -e "\nskipped files: \n$(grep -irl skip-file *)" | |
ubuntu_test_doc: | |
needs: pep8_check | |
strategy: | |
matrix: | |
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md | |
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md | |
# we could also use: ubuntu-latest | |
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest] | |
install_method: [basic, pip] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: apt-get update | |
run: sudo apt-get update | |
- name: install dependencies (ubuntu packages) | |
if: matrix.install_method == 'basic' | |
run: sudo apt-get install python3-setuptools hashdeep | |
- name: install dependencies (ubuntu packages) | |
if: matrix.install_method == 'pip' | |
run: sudo apt-get install python3-setuptools python3-pip hashdeep | |
- name: check all modules available | |
run: env python3 setup.py check_modules | |
- name: install pfu with python | |
if: matrix.install_method == 'basic' | |
run: sudo python3 setup.py install | |
- name: install pfu with pip | |
if: matrix.install_method == 'pip' | |
run: sudo pip3 install . | |
- name: run pfu | |
run: | | |
which pfu | |
pfu -h | |
pfu simscrub -h | |
pfu create_checksum -h | |
pfu check_checksum -h | |
pfu replicate -h | |
pfu speed_test -h | |
- name: unittest | |
run: env python3 setup.py run_unittest | |
- name: install dependencies for pytest (ubuntu packages) | |
run: sudo apt-get install python3-pytest python3-pytest-cov python3-pytest-xdist | |
- name: pytest | |
run: env python3 setup.py run_pytest --parallel --coverage | |
macos-11_test: | |
needs: pep8_check | |
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies using pip | |
run: sudo pip3 install setuptools | |
- name: check all modules available | |
run: env python3 setup.py check_modules | |
- name: install pfu | |
run: sudo pip3 install . | |
- name: run pfu | |
run: | | |
which pfu | |
pfu -h | |
pfu simscrub -h | |
pfu create_checksum -h | |
pfu check_checksum -h | |
pfu replicate -h | |
pfu speed_test -h | |
- name: unittest | |
run: env python3 setup.py run_unittest | |
- name: install dependencies via pip3 | |
run: pip3 install wheel pytest pytest-cov pytest-xdist | |
- name: pytest | |
run: env python3 setup.py run_pytest --parallel --coverage | |
macos-12_test: | |
needs: pep8_check | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies using pip | |
run: sudo pip3 install setuptools | |
- name: check all modules available | |
run: env python3 setup.py check_modules | |
- name: install pfu | |
run: sudo pip3 install . | |
- name: run pfu | |
run: | | |
which pfu | |
pfu -h | |
pfu simscrub -h | |
pfu create_checksum -h | |
pfu check_checksum -h | |
pfu replicate -h | |
pfu speed_test -h | |
- name: unittest | |
run: env python3 setup.py run_unittest | |
- name: install dependencies via pip3 | |
run: pip3 install wheel pytest pytest-cov pytest-xdist | |
- name: pytest | |
run: env python3 setup.py run_pytest --parallel --coverage | |
macos-13_test: | |
needs: pep8_check | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies using pip | |
run: sudo pip3 install setuptools | |
- name: check all modules available | |
run: env python3 setup.py check_modules | |
- name: install pfu | |
run: sudo pip3 install . | |
- name: run pfu | |
run: | | |
which pfu | |
pfu -h | |
pfu simscrub -h | |
pfu create_checksum -h | |
pfu check_checksum -h | |
pfu replicate -h | |
pfu speed_test -h | |
- name: unittest | |
run: env python3 setup.py run_unittest | |
- name: install dependencies via pip3 | |
run: pip3 install wheel pytest pytest-cov pytest-xdist | |
- name: pytest | |
run: env python3 setup.py run_pytest --parallel --coverage | |
windows_test: | |
needs: pep8_check | |
strategy: | |
matrix: | |
# we need setuputils to create binaries for windows | |
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2016-Readme.md | |
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md | |
os: [windows-2019, windows-2022] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: conda init powershell | |
run: | | |
&($env:CONDA + "\Scripts\conda") init powershell | |
- name: install dependencies via conda | |
run: conda install -c conda-forge python pytest pytest-cov pytest-xdist | |
- name: check all modules available | |
run: python setup.py check_modules | |
- name: install pfu | |
run: python setup.py install | |
- name: run pfu | |
run: | | |
Get-Command pfu | |
pfu -h | |
pfu simscrub -h | |
pfu create_checksum -h | |
pfu check_checksum -h | |
pfu replicate -h | |
pfu speed_test -h | |
- name: unittest | |
run: python setup.py run_unittest | |
- name: pytest | |
run: python setup.py run_pytest --parallel --coverage | |
freebsd_test: | |
needs: pep8_check | |
# https://github.com/marketplace/actions/freebsd-vm | |
runs-on: ubuntu-22.04 | |
name: run tests on FreeBSD | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test in FreeBSD | |
id: test | |
uses: vmactions/freebsd-vm@v1 | |
with: | |
usesh: true | |
prepare: pkg install -y devel/py-setuptools devel/py-pytest devel/py-pytest-cov devel/py-pip | |
run: | | |
set -e -x | |
cat /etc/os-release | |
freebsd-version | |
pwd | |
ls -lah | |
whoami | |
freebsd-version | |
which python3.9 | |
pip install . | |
which pfu | |
pfu -h | |
pfu simscrub -h | |
pfu create_checksum -h | |
pfu check_checksum -h | |
pfu replicate -h | |
pfu speed_test -h | |
python3.9 setup.py run_unittest | |
python3.9 setup.py run_pytest --coverage | |
amd64_opensuse_leap_154_test: | |
needs: pep8_check | |
# https://github.com/daniel-mohr/amd64_opensuse_leap_15.4 | |
runs-on: ubuntu-latest | |
name: opensuse leap 15.4 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: create test script for docker | |
run: | | |
echo "#!/bin/sh -l" > do_test | |
echo "set -e -x" >> do_test | |
echo "cat /etc/os-release" >> do_test | |
echo "zypper --non-interactive install which python3 python3-setuptools python3-pytest python3-pytest-cov python3-pytest-xdist hashdeep" >> do_test | |
echo "env python3 -V" >> do_test | |
echo "env python3 setup.py check_modules" >> do_test | |
echo "env python3 setup.py install" >> do_test | |
echo "which pfu" >> do_test | |
echo "pfu -h" >> do_test | |
echo "pfu simscrub -h" >> do_test | |
echo "pfu create_checksum -h" >> do_test | |
echo "pfu check_checksum -h" >> do_test | |
echo "pfu replicate -h" >> do_test | |
echo "pfu speed_test -h" >> do_test | |
echo "env python3 setup.py run_unittest" >> do_test | |
echo "env python3 setup.py run_pytest --parallel --coverage" >> do_test | |
chmod +x do_test | |
- name: cat test script | |
run: cat do_test | |
- name: run my script in docker image | |
uses: daniel-mohr/amd64_opensuse_leap_15.4@v0 | |
with: | |
cmdfile: ./do_test | |
amd64_opensuse_leap_155_test: | |
needs: pep8_check | |
# https://github.com/daniel-mohr/amd64_opensuse_leap_15.5 | |
runs-on: ubuntu-latest | |
name: opensuse leap 15.5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: create test script for docker | |
run: | | |
echo "#!/bin/sh -l" > do_test | |
echo "set -e -x" >> do_test | |
echo "cat /etc/os-release" >> do_test | |
echo "zypper --non-interactive install which python3 python3-setuptools python3-pytest python3-pytest-cov python3-pytest-xdist hashdeep" >> do_test | |
echo "env python3 -V" >> do_test | |
echo "env python3 setup.py check_modules" >> do_test | |
echo "env python3 setup.py install" >> do_test | |
echo "which pfu" >> do_test | |
echo "pfu -h" >> do_test | |
echo "pfu simscrub -h" >> do_test | |
echo "pfu create_checksum -h" >> do_test | |
echo "pfu check_checksum -h" >> do_test | |
echo "pfu replicate -h" >> do_test | |
echo "pfu speed_test -h" >> do_test | |
echo "env python3 setup.py run_unittest" >> do_test | |
echo "env python3 setup.py run_pytest --parallel --coverage" >> do_test | |
chmod +x do_test | |
- name: cat test script | |
run: cat do_test | |
- name: run my script in docker image | |
uses: daniel-mohr/amd64_opensuse_leap_15.5@v0 | |
with: | |
cmdfile: ./do_test | |
amd64_opensuse_leap_latest_test: | |
needs: pep8_check | |
# https://github.com/daniel-mohr/amd64_opensuse_leap_latest | |
runs-on: ubuntu-latest | |
name: opensuse leap latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: create test script for docker | |
run: | | |
echo "#!/bin/sh -l" > do_test | |
echo "set -e -x" >> do_test | |
echo "cat /etc/os-release" >> do_test | |
echo "zypper --non-interactive install which python3 python3-setuptools python3-pytest python3-pytest-cov python3-pytest-xdist hashdeep" >> do_test | |
echo "env python3 -V" >> do_test | |
echo "env python3 setup.py check_modules" >> do_test | |
echo "env python3 setup.py install" >> do_test | |
echo "which pfu" >> do_test | |
echo "pfu -h" >> do_test | |
echo "pfu simscrub -h" >> do_test | |
echo "pfu create_checksum -h" >> do_test | |
echo "pfu check_checksum -h" >> do_test | |
echo "pfu replicate -h" >> do_test | |
echo "pfu speed_test -h" >> do_test | |
echo "env python3 setup.py run_unittest" >> do_test | |
echo "env python3 setup.py run_pytest --parallel --coverage" >> do_test | |
chmod +x do_test | |
- name: cat test script | |
run: cat do_test | |
- name: run my script in docker image | |
uses: daniel-mohr/amd64_opensuse_leap_latest@v1 | |
with: | |
cmdfile: ./do_test | |
i386_debian_latest_test: | |
needs: pep8_check | |
# https://github.com/daniel-mohr/i386_debian_latest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: create test script for docker | |
run: | | |
echo "#!/bin/sh -l" > do_test | |
echo "set -e -x" >> do_test | |
echo "cat /etc/os-release" >> do_test | |
echo "DEBIAN_FRONTEND=noninteractive apt-get install -q -y python3-setuptools python3-pip hashdeep python3-pytest python3-pytest-cov python3-pytest-xdist" >> do_test | |
echo "env python3 setup.py check_modules" >> do_test | |
echo "pip3 install --break-system-packages ." >> do_test | |
echo "which pfu" >> do_test | |
echo "pfu -h" >> do_test | |
echo "pfu simscrub -h" >> do_test | |
echo "pfu create_checksum -h" >> do_test | |
echo "pfu check_checksum -h" >> do_test | |
echo "pfu replicate -h" >> do_test | |
echo "pfu speed_test -h" >> do_test | |
echo "env python3 setup.py run_unittest" >> do_test | |
echo "env python3 setup.py run_pytest --parallel --coverage" >> do_test | |
chmod +x do_test | |
- name: cat test script | |
run: cat do_test | |
- name: run my script in docker image | |
uses: daniel-mohr/i386_debian_latest@v0 | |
with: | |
cmdfile: ./do_test |