forked from Graviti-AI/tensorbay-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.86 KB
/
unit_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
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
---
name: Unit Test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-18.04, macos-10.15, windows-2019]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Cache python ${{ matrix.python-version }} in ubuntu
if: "matrix.os == 'ubuntu-18.04'"
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Python/${{ matrix.python-version }}
key: >-
unit-test-${{ matrix.os }}-${{ matrix.python-version }}-
${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_test.txt') }}
- name: Cache python ${{ matrix.python-version }} in macos
if: "matrix.os == 'macos-10.15'"
uses: actions/cache@v2
with:
path: /Users/runner/hostedtoolcache/Python/${{ matrix.python-version }}
key: >-
unit-test-${{ matrix.os }}-${{ matrix.python-version }}-
${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_test.txt') }}
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements_test.txt
- name: Run pytest
run: pytest tensorbay
- if: "matrix.os == 'ubuntu-18.04' && matrix.python-version == 3.8"
name: Upload coverage data to coveralls.io
run: |
pytest tensorbay --cov
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}