-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (63 loc) · 2.03 KB
/
run-tests.yaml
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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
run_tests:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
poetry-version: [1.1.12]
os: [ubuntu-18.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry==${{ matrix.poetry-version }}
- name: Cache poetry venv
uses: actions/cache@v3
id: cache
with:
path: ./src/.venv
key: poetry-${{ hashFiles('./src/pyproject.toml') }}
- name: Install other dependencies
run: sudo apt-get install -y graphviz graphviz-dev
- name: Install pip requirements
run: pip install -r requirements.txt
- name: Update poetry config
working-directory: ./src
run: poetry config virtualenvs.in-project true
- name: Install poetry dependencies
working-directory: ./src
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: Install huspacy model
working-directory: ./src
run: poetry run python -c "import huspacy; huspacy.download('hu_core_news_trf')"
if: steps.cache.outputs.cache-hit != 'true'
- name: Cache fasttext model
uses: actions/cache@v3
id: cache-fasttext
with:
path: /tmp/lid.176.bin
key: fasttext
- name: Install fasttext model
run: wget -O /tmp/lid.176.bin https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin
if: steps.cache-fasttext.outputs.cache-hit != 'true'
- name: Cache stanza models
uses: actions/cache@v3
id: cache-stanza
with:
path: ~/stanza_resources
key: stanza
- name: Run tests
working-directory: ./src
env:
CICD: true
run: PYTHONPATH=. poetry run python -m pytest -v --cov=hu_nmt/data_augmentator hu_nmt/test