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
|
2021-09-19 20:20:56 +06:00
|
|
|
steps:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2021-09-20 15:24:11 +06:00
|
|
|
|
2021-11-20 19:14:59 +06:00
|
|
|
- name: Install compilers
|
|
|
|
run: |
|
2022-06-15 23:29:55 +06:00
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
|
|
|
|
sudo 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
|
2022-10-08 21:51:15 +06:00
|
|
|
./bundle_migration_plugin.sh
|
2021-09-19 20:20:56 +06:00
|
|
|
|
|
|
|
- name: Upload
|
2024-08-07 13:52:56 +06:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-09-19 20:20:56 +06:00
|
|
|
with:
|
2022-10-08 21:51:15 +06:00
|
|
|
name: calibre-plugins
|
2021-09-19 20:20:56 +06:00
|
|
|
path: |
|
2021-09-20 15:24:11 +06:00
|
|
|
calibre-plugin.zip
|
2022-10-09 14:24:59 +06:00
|
|
|
calibre-migration-plugin.zip
|
2023-05-06 21:51:45 +06:00
|
|
|
|
2023-09-03 00:11:27 +06:00
|
|
|
test-python3:
|
2023-05-06 21:51:45 +06:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-05-12 15:26:23 +06:00
|
|
|
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
|
|
|
|
# 3.5 is broken due to SSL issues? Todo.
|
|
|
|
# 3.13-dev currently broken due to lxml
|
2023-05-06 21:51:45 +06:00
|
|
|
steps:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-06 21:51:45 +06:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-05-12 15:22:52 +06:00
|
|
|
uses: actions/setup-python@v5
|
2023-05-06 21:51:45 +06:00
|
|
|
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
|
2023-09-03 00:11:27 +06:00
|
|
|
|
|
|
|
test-python2:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
container: python:2.7
|
|
|
|
steps:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-03 00:11:27 +06:00
|
|
|
|
|
|
|
- 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
|
2023-05-06 21:51:45 +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:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-19 04:53:51 +06:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-05-06 21:51:45 +06:00
|
|
|
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
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
|
2023-05-06 21:51:45 +06:00
|
|
|
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
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-07-28 22:07:52 +06:00
|
|
|
test-ubuntu-2204-oscrypto:
|
2022-05-14 14:43:55 +06:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2024-05-12 15:26:23 +06:00
|
|
|
- uses: actions/checkout@v4
|
2022-05-14 14:43:55 +06:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2023-05-06 15:28:42 +06:00
|
|
|
id: pip-stuff
|
|
|
|
continue-on-error: true
|
2022-05-14 14:43:55 +06:00
|
|
|
run: |
|
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.
|
2023-05-06 21:51:45 +06:00
|
|
|
pip3 install "oscrypto>1.3.0"
|
|
|
|
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
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
|
2023-05-06 21:51:45 +06:00
|
|
|
pip2 --no-python-version-warning install "oscrypto>1.3.0"
|
|
|
|
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
2022-05-14 14:43:55 +06:00
|
|
|
|
|
|
|
- name: Run tests (Python 3)
|
2023-05-06 15:28:42 +06:00
|
|
|
if: steps.pip-stuff.outcome == 'success' && steps.pip-stuff.conclusion == 'success'
|
2022-05-14 14:43:55 +06:00
|
|
|
run: |
|
|
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
|
2022-05-14 14:54:14 +06:00
|
|
|
- name: Run tests (Python 2)
|
2023-05-06 15:28:42 +06:00
|
|
|
if: steps.pip-stuff.outcome == 'success' && steps.pip-stuff.conclusion == 'success'
|
2022-05-14 14:54:14 +06:00
|
|
|
run: |
|
|
|
|
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..
|
|
|
|
|
2022-07-28 22:07:52 +06:00
|
|
|
test-ubuntu-2204-oscrypto-fork:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-28 22:07:52 +06:00
|
|
|
|
|
|
|
- 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
|
2023-12-19 11:45:01 +06:00
|
|
|
pip3 install https://github.com/Leseratte10/acsm-calibre-plugin/releases/download/config/oscrypto_1.3.0_fork_2023-12-19.zip
|
2023-05-06 21:51:45 +06:00
|
|
|
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
2022-07-28 22:07:52 +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
|
2023-12-19 11:45:01 +06:00
|
|
|
pip2 --no-python-version-warning install https://github.com/Leseratte10/acsm-calibre-plugin/releases/download/config/oscrypto_1.3.0_fork_2023-12-19.zip
|
2023-05-06 21:51:45 +06:00
|
|
|
pip2 --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
|
2022-07-28 22:07:52 +06:00
|
|
|
|
|
|
|
- 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 ..
|
|
|
|
|
|
|
|
|
2022-05-14 14:54:14 +06:00
|
|
|
test-windows:
|
|
|
|
runs-on: windows-2022
|
|
|
|
steps:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2022-05-14 14:54:14 +06:00
|
|
|
|
|
|
|
- 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.
|
2023-05-06 21:51:45 +06:00
|
|
|
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
2022-05-14 14:54:14 +06:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Run tests (Python 3)
|
|
|
|
run: |
|
|
|
|
cd tests && python3 ./main.py && cd ..
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
|
|
|
|
test-mac:
|
2024-05-12 15:22:52 +06:00
|
|
|
runs-on: macos-12
|
2022-05-14 14:54:14 +06:00
|
|
|
steps:
|
2024-05-12 15:22:52 +06:00
|
|
|
- uses: actions/checkout@v4
|
2022-05-14 14:54:14 +06:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-05-06 21:51:45 +06:00
|
|
|
pip3 install -r ./.github/workflows/ci_test_requirements.txt
|
2022-05-14 14:54:14 +06:00
|
|
|
|
|
|
|
- name: Run tests (Python 3)
|
|
|
|
run: |
|
|
|
|
cd tests && python3 ./main.py && cd ..
|