2021-09-19 20:20:56 +06:00
|
|
|
name: Build binaries
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
2022-05-14 14:43:55 +06:00
|
|
|
build:
|
2022-05-14 14:54:14 +06:00
|
|
|
runs-on: ubuntu-20.04
|
2022-05-19 22:12:51 +06:00
|
|
|
container: debian:bullseye
|
2021-09-19 20:20:56 +06:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-20 15:24:11 +06:00
|
|
|
|
2021-11-20 19:14:59 +06:00
|
|
|
- name: Install compilers
|
|
|
|
run: |
|
2022-05-19 22:12:51 +06:00
|
|
|
apt update
|
|
|
|
apt install -y gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
|
|
|
|
apt install -y wget make zip
|
2021-11-20 19:14:59 +06:00
|
|
|
|
2021-09-19 20:20:56 +06:00
|
|
|
- name: Compile
|
|
|
|
run: |
|
2021-09-20 15:24:11 +06:00
|
|
|
./bundle_calibre_plugin.sh
|
2021-09-19 20:20:56 +06:00
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux
|
|
|
|
path: |
|
2021-09-20 15:24:11 +06:00
|
|
|
calibre-plugin.zip
|
2021-12-19 04:53:51 +06:00
|
|
|
|
2022-05-14 14:43:55 +06:00
|
|
|
test-ubuntu-2004:
|
|
|
|
runs-on: ubuntu-20.04
|
2021-12-19 04:53:51 +06:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-12-20 03:13:19 +06:00
|
|
|
# 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"
|
2022-01-16 22:43:29 +06:00
|
|
|
# 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
|
2021-12-19 04:53:51 +06:00
|
|
|
|
2022-01-16 22:43:29 +06:00
|
|
|
- name: Run tests (Python 3)
|
2021-12-19 04:53:51 +06:00
|
|
|
run: |
|
2022-01-16 22:43:29 +06:00
|
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
|
|
|
|
- name: Run tests (Python 2)
|
|
|
|
run: |
|
|
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..
|
2021-12-19 04:53:51 +06:00
|
|
|
|
2022-05-14 14:43:55 +06:00
|
|
|
test-ubuntu-2204:
|
|
|
|
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.
|
2022-05-16 11:13:41 +06:00
|
|
|
# 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"
|
2022-05-14 14:43:55 +06:00
|
|
|
# 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
|
2022-05-16 11:13:41 +06:00
|
|
|
pip2 install freezegun mock lxml pycryptodome "rsa<=4.3" "oscrypto>1.3.0" cryptography==3.1
|
2022-05-14 14:43:55 +06:00
|
|
|
|
|
|
|
- name: Run tests (Python 3)
|
|
|
|
run: |
|
|
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
|
2022-05-14 14:54:14 +06:00
|
|
|
- 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 ..
|
|
|
|
|
2022-05-14 14:43:55 +06:00
|
|
|
- name: Run tests (Python 2)
|
|
|
|
run: |
|
|
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..
|