-
-
Notifications
You must be signed in to change notification settings - Fork 23
74 lines (63 loc) · 2.16 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
# vim: fileencoding=UTF-8:expandtab:autoindent:ts=2:sts=2:sw=2:filetype=yaml
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: CI
# Controls when the action will run. Workflow runs when manually triggered
# using the UI or API.
'on':
push:
branches:
- '*'
pull_request:
# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
PLATFORM=$(uname)
if [ "${PLATFORM}" = "Linux" ]; then
sudo apt-get install -y zsh gettext
fi
# yamllint disable rule:line-length
- name: Set environment variables
run: |
CALIBRE_DIR="$(mktemp -d XXXXXXXX)"
printf 'CALIBRE_DIR="%s"\n' "${CALIBRE_DIR}" >>"${GITHUB_ENV}"
printf 'CALIBRE_CONFIG_DIRECTORY="%s"\n' "${CALIBRE_DIR}/config" >>"${GITHUB_ENV}"
printf 'CALIBRE_TEMP_DIR="%s"\n' "${CALIBRE_DIR}/tmp" >>"${GITHUB_ENV}"
# yamllint enable rule:line-length
- name: Create calibre directories
run: |
mkdir -p "${CALIBRE_CONFIG_DIRECTORY}" "${CALIBRE_TEMP_DIR}"
- name: Install calibre from upstream
run: ./scripts/update-calibre.py
- name: Build plugin ZIP files
run: ./scripts/build.sh
- name: Install Python test dependencies
run: |
set -x
python3 -m pip install --upgrade pip
if [ -f requirements.txt ]; then
python3 -m pip install -r requirements.txt
fi
if [ -f scripts/requirements.txt ]; then
python3 -m pip install -r scripts/requirements.txt
fi
if [ -f tests/requirements.txt ]; then
python3 -m pip install -r tests/requirements.txt
fi
- name: Run calibre Python ${{ matrix.python-version }} tests
run: ./scripts/build.sh test