mirror of
https://github.com/Leseratte10/acsm-calibre-plugin
synced 2024-11-15 19:48:29 +01:00
Add more CI testing
This commit is contained in:
parent
f5e19f4391
commit
a7013047d2
2 changed files with 43 additions and 14 deletions
11
.github/workflows/ci_test_requirements.txt
vendored
Normal file
11
.github/workflows/ci_test_requirements.txt
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
freezegun
|
||||
mock ; python_version < '3.0'
|
||||
lxml
|
||||
pycryptodome
|
||||
rsa ; python_version >= '3.0'
|
||||
rsa <= 4.3 ; python_version < '3.0'
|
||||
oscrypto
|
||||
|
||||
# Require cryptography >= 3.1 because in 3.0 and below, the backend param in load_key_and_certificates was still required.
|
||||
cryptography==3.1 ; python_version < '3.0'
|
||||
cryptography>=3.1 ; python_version >= '3.0'
|
46
.github/workflows/main.yml
vendored
46
.github/workflows/main.yml
vendored
|
@ -28,7 +28,26 @@ jobs:
|
|||
path: |
|
||||
calibre-plugin.zip
|
||||
calibre-migration-plugin.zip
|
||||
|
||||
|
||||
test-all-python-versions:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["2.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
# 3.12-dev doesn't work yet due to lxml
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install python requirements
|
||||
run: pip install -r ./.github/workflows/ci_test_requirements.txt
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests && python --version && PYTHONWARNINGS=ignore python ./main.py
|
||||
|
||||
|
||||
test-ubuntu-2004:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
@ -36,12 +55,11 @@ jobs:
|
|||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Require cryptography >= 3.1 because in 3.0 and below, the backend param in load_key_and_certificates was still required.
|
||||
pip3 install freezegun lxml pycryptodome rsa oscrypto "cryptography>=3.1"
|
||||
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
||||
# Install Python2 stuff
|
||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
||||
python2 get-pip.py
|
||||
pip2 --no-python-version-warning install freezegun mock lxml pycryptodome "rsa<=4.3" oscrypto cryptography==3.1
|
||||
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
||||
|
||||
- name: Run tests (Python 3)
|
||||
run: |
|
||||
|
@ -60,14 +78,15 @@ jobs:
|
|||
id: pip-stuff
|
||||
continue-on-error: true
|
||||
run: |
|
||||
# Require cryptography >= 3.1 because in 3.0 and below, the backend param in load_key_and_certificates was still required.
|
||||
# Require oscrypto > 1.3.0 because all versions until 1.3.0 had no (or broken) OpenSSL 3 support.
|
||||
pip3 install freezegun lxml pycryptodome rsa "oscrypto>1.3.0" "cryptography>=3.1"
|
||||
pip3 install "oscrypto>1.3.0"
|
||||
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
||||
# Install Python2 stuff
|
||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
||||
sudo apt install python2
|
||||
python2 get-pip.py
|
||||
pip2 --no-python-version-warning install freezegun mock lxml pycryptodome "rsa<=4.3" "oscrypto>1.3.0" cryptography==3.1
|
||||
pip2 --no-python-version-warning install "oscrypto>1.3.0"
|
||||
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
||||
|
||||
- name: Run tests (Python 3)
|
||||
if: steps.pip-stuff.outcome == 'success' && steps.pip-stuff.conclusion == 'success'
|
||||
|
@ -88,14 +107,14 @@ jobs:
|
|||
run: |
|
||||
# Require cryptography >= 3.1 because in 3.0 and below, the backend param in load_key_and_certificates was still required.
|
||||
# Installing a forked version of oscrypto to fix OpenSSL 3 issues
|
||||
pip3 install freezegun lxml pycryptodome rsa "cryptography>=3.1"
|
||||
pip3 install https://github.com/Leseratte10/acsm-calibre-plugin/releases/download/config/oscrypto_1.3.0_fork_fe39273cc5020.zip
|
||||
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
||||
# Install Python2 stuff
|
||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
||||
sudo apt install python2
|
||||
python2 get-pip.py
|
||||
pip2 --no-python-version-warning install freezegun mock lxml pycryptodome "rsa<=4.3" cryptography==3.1
|
||||
pip2 --no-python-version-warning install https://github.com/Leseratte10/acsm-calibre-plugin/releases/download/config/oscrypto_1.3.0_fork_fe39273cc5020.zip
|
||||
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
||||
|
||||
- name: Run tests (Python 3)
|
||||
run: |
|
||||
|
@ -114,7 +133,7 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
# Require cryptography >= 3.1 because in 3.0 and below, the backend param in load_key_and_certificates was still required.
|
||||
pip3 install freezegun lxml pycryptodome rsa oscrypto "cryptography>=3.1"
|
||||
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
||||
shell: bash
|
||||
|
||||
- name: Run tests (Python 3)
|
||||
|
@ -130,7 +149,7 @@ jobs:
|
|||
- name: Install deps for Python 2
|
||||
run: |
|
||||
# Install Python2 stuff
|
||||
python -m pip --no-python-version-warning install freezegun mock lxml pycryptodome "rsa<=4.3" oscrypto cryptography==3.1
|
||||
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
||||
|
||||
- name: Run tests (Python 2)
|
||||
run: |
|
||||
|
@ -145,12 +164,11 @@ jobs:
|
|||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Require cryptography >= 3.1 because in 3.0 and below, the backend param in load_key_and_certificates was still required.
|
||||
pip3 install freezegun lxml pycryptodome rsa oscrypto "cryptography>=3.1"
|
||||
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
||||
# Install Python2 stuff
|
||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
||||
python2 get-pip.py
|
||||
pip2 --no-python-version-warning install freezegun mock lxml pycryptodome "rsa<=4.3" oscrypto cryptography==3.1
|
||||
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
||||
|
||||
- name: Run tests (Python 3)
|
||||
run: |
|
||||
|
|
Loading…
Reference in a new issue