-
Notifications
You must be signed in to change notification settings - Fork 10
69 lines (58 loc) · 1.55 KB
/
test-deploy.yml
File metadata and controls
69 lines (58 loc) · 1.55 KB
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
name: Test and Deploy
on:
push:
branches:
- master
tags:
- v*
pull_request:
concurrency:
group: >-
${{ github.workflow }}-
${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
platform: ["ubuntu-latest", "windows-latest"]
python-version: ["3.7",]
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
- name: Conda env check
run: conda env list
- name: Install dependencies
run: make install
- name: Run tests
run: make test-cov
- name: Codecov upload
run: codecov
build_publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'Yvictor/sjtrade'
needs: [test]
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.7
- name: Install Dependency
run: make install-flit
- name: Publish package to PyPI
env:
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
run: |
flit build
flit publish