-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (67 loc) · 2.21 KB
/
test.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
65
66
67
68
name: Testing
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]
os: ["ubuntu-latest", "macOS-latest"] # add "windows-latest" when possible
env:
# From https://stackoverflow.com/a/55310803/3252477 for pipenv
PIPENV_DIR: $GITHUB_WORKSPACE/.pipenv
PIP_CACHE_DIR: $PIPENV_DIR/pipcache
runs-on: ${{ matrix.os }}
name: Testing - Python ${{ matrix.python-version }} - ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
# Setup the cache
- name: Cache pipenv dependencies
uses: actions/cache@v1
with:
path: $PIPENV_DIR
key: python-${{ runner.OS }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
python-${{ runner.OS }}-
python-
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: nodejs-${{ runner.OS }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodejs-${{ runner.OS }}-
nodejs-
# Build and test the project
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: "x64" # (x64 or x86)
- if: matrix.os == 'ubuntu-latest'
name: Install pipenv Linux
run: sudo pip3 install pipenv
- if: matrix.os == 'windows-latest'
name: Install pipenv Windows
run: pip install pipenv
- if: matrix.os == 'macOS-latest'
name: Install pipenv MacOS
run: brew install pipenv
- name: Install python dependencies
run: pipenv install --dev --python ${{ matrix.python-version }}
- name: Formatting check with black
run: pipenv run black . --check
- name: linting with pylint
run: pipenv run pylint universions
- name: Order imports with isort
run: pipenv run isort . --recursive --check-only
- name: Run all tests with pytest
run: pipenv run pytest .
- name: Install javascript dependencies
run: yarn install
- name: Typing check with pyright
run: yarn run pyright universions