mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-23 01:34:36 +06:00
76f67a2048
The latest version of oscrypto does not yet support OpenSSL 3, which is used in Ubuntu 22.04, Fedora 36 and a bunch of other newer Linux distributions. When https://github.com/wbond/oscrypto/pull/61 is merged and included in a new release, this change will be reverted.
155 lines
5.2 KiB
YAML
155 lines
5.2 KiB
YAML
name: Build binaries
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install compilers
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
|
|
sudo apt install -y wget make zip
|
|
|
|
- name: Compile
|
|
run: |
|
|
./bundle_calibre_plugin.sh
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: linux
|
|
path: |
|
|
calibre-plugin.zip
|
|
|
|
test-ubuntu-2004:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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"
|
|
# Install Python2 stuff
|
|
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
|
python2 get-pip.py
|
|
pip2 install freezegun mock lxml pycryptodome "rsa<=4.3" oscrypto cryptography==3.1
|
|
|
|
- name: Run tests (Python 3)
|
|
run: |
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
- name: Run tests (Python 2)
|
|
run: |
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..
|
|
|
|
test-ubuntu-2204-oscrypto:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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.
|
|
# 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"
|
|
# 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 install freezegun mock lxml pycryptodome "rsa<=4.3" "oscrypto>1.3.0" cryptography==3.1
|
|
|
|
- name: Run tests (Python 3)
|
|
run: |
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
- name: Run tests (Python 2)
|
|
run: |
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..
|
|
|
|
test-ubuntu-2204-oscrypto-fork:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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.
|
|
# 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
|
|
# 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 install freezegun mock lxml pycryptodome "rsa<=4.3" cryptography==3.1
|
|
pip2 install https://github.com/Leseratte10/acsm-calibre-plugin/releases/download/config/oscrypto_1.3.0_fork_fe39273cc5020.zip
|
|
|
|
- name: Run tests (Python 3)
|
|
run: |
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
- name: Run tests (Python 2)
|
|
run: |
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..
|
|
|
|
|
|
test-windows:
|
|
runs-on: windows-2022
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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"
|
|
shell: bash
|
|
|
|
- name: Run tests (Python 3)
|
|
run: |
|
|
cd tests && python3 ./main.py && cd ..
|
|
shell: bash
|
|
|
|
- name: Setup Python 2
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: '2.x'
|
|
|
|
- name: Install deps for Python 2
|
|
run: |
|
|
# Install Python2 stuff
|
|
python -m pip install freezegun mock lxml pycryptodome "rsa<=4.3" oscrypto cryptography==3.1
|
|
|
|
- name: Run tests (Python 2)
|
|
run: |
|
|
cd tests && PYTHONWARNINGS=ignore python ./main.py && cd ..
|
|
shell: bash
|
|
|
|
|
|
test-mac:
|
|
runs-on: macos-11
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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"
|
|
# Install Python2 stuff
|
|
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
|
python2 get-pip.py
|
|
pip2 install freezegun mock lxml pycryptodome "rsa<=4.3" oscrypto cryptography==3.1
|
|
|
|
- name: Run tests (Python 3)
|
|
run: |
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
- name: Run tests (Python 2)
|
|
run: |
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd .. |