forked from glutanimate/pytest-anki
-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (60 loc) · 1.9 KB
/
tests.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
name: tests
on:
push:
paths-ignore:
- "README.md"
- "docs/**"
pull_request:
paths-ignore:
- "README.md"
- "docs/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Checkout pytest-anki
uses: actions/checkout@v2
- name: Checkout anki
uses: actions/checkout@v2
with:
repository: dae/anki
path: anki_root
- name: Checkout latest Anki tag
working-directory: anki_root
run: |
git fetch --tags
git checkout $(git tag --sort=version:refname | tail -1)
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Set up node build dependency for anki
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up protoc build dependency for anki
uses: Arduino/actions/setup-protoc@master
# venv is automatically set up by this step
# FIXME: currently bypassing pip installation due to a pip bug
# https://github.com/pypa/pip/issues/7217
- name: Install anki dependencies and build anki
working-directory: anki_root
run: |
sudo apt-get install portaudio19-dev gettext rename
sed -i 's/pip install --upgrade pip setuptools/true/g' Makefile
pip install --upgrade pip==19.3.1 setuptools==45.0.0
make build BUILDFLAGS=""
make develop
- name: Install pytest-anki and its dependencies
run: |
. ./anki_root/pyenv/bin/activate
sudo apt-get install xvfb libxkbcommon-x11-0
pip install .
- name: Run tests
run: |
. ./anki_root/pyenv/bin/activate
./tools/run_tests.sh