-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.78 KB
/
ci_master.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
name: build
# This workflow is triggered on push or pull request to master branch only.
# It is also run on schedule once a week, to regularly check that the environment
# is working as expected. This is run at 00:00 every Monday.
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '0 0 * * 1'
# Defining the jobs to be run. The first job checks all the tests pass. The second job is
# executed only if the first job passed, and it updates the coverage on coveralls.
jobs:
build:
name: Build
runs-on: ubuntu-latest #, macos-latest] # running tests on both Linux and MacOs environments
strategy:
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install pytest-cov coveralls
python3 -m nltk.downloader punkt
# it needs 'punkt' in order to work properly (dataset is not downloaded by default at main nltk installation)
- name: Run tests with pytest
env:
PYTHONHASHSEED: 123 # required for deterministic reproducibility of two Word2Vec tests
run: |
python3 -m pytest -v --cov-report term-missing --cov=pdf2emb_nlp
- name: Upload Coverage to coveralls.io
if: ${{ matrix.python-version == '3.7' }}
# only update coverage when running on Python 3.7 (no need to this for all versions)
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls