-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
95 lines (82 loc) · 2.13 KB
/
ci.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: conda-build
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@latest
with:
fetch-depth: 0
- name: Cache conda
uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
use-only-tar-bz2: true
- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
- name: Setup QuantEcon
shell: bash -l {0}
run: |
python -m pip install -U pip
pip install .[testing]
- name: flake8 Tests
shell: bash -l {0}
run: |
flake8 --select F401, F405, E231 quantecon
- name: Run Tests (pytest)
shell: bash -l {0}
run: |
coverage run -m pytest quantecon
coverage lcov
- name: Coveralls
uses: coverallsapp/github-action@master
if: runner.os == 'Linux'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
publish:
name: Publish to PyPi
needs: [tests]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@latest
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install flit
run: |
pip install flit~=3.6
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}