-
Notifications
You must be signed in to change notification settings - Fork 196
93 lines (77 loc) · 2.54 KB
/
ci.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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
defaults:
run:
shell: bash -l {0}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nb-sync:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
- name: Install nbdev
run: pip install nbdev
- name: Check if all notebooks are cleaned
run: |
echo "Check we are starting with clean git checkout"
if [ -n "$(git status -uno -s)" ]; then echo "git status is not clean"; false; fi
echo "Trying to strip out notebooks"
nbdev_clean
echo "Check that strip out was unnecessary"
git status -s # display the status to see which nbs need cleaning up
if [ -n "$(git status -uno -s)" ]; then echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_git_hooks"; false; fi
check-import:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9, '3.10']
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install nixtla
run: pip install ./
- name: Check import
run: python -c "from nixtlats import TimeGPT;"
run-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, '3.10']
env:
TIMEGPT_TOKEN: ${{ secrets.TIMEGPT_TOKEN }}
TIMEGPT_API_URL: ${{ secrets.TIMEGPT_API_URL }}
TIMEGPT_CUSTOM_URL_TOKEN: ${{ secrets.TIMEGPT_CUSTOM_URL_TOKEN }}
TIMEGPT_CUSTOM_URL: ${{ secrets.TIMEGPT_CUSTOM_URL }}
API_KEY_FRED: ${{ secrets.API_KEY_FRED }}
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Set up environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
create-args: python=${{ matrix.python-version }}
cache-environment: true
- name: Install pip requirements
run: pip install -e ".[dev]"
- name: Run tests
run: nbdev_test --skip_file_glob "*distributed*"
- name: Run tests with distributed (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: nbdev_test --file_glob "*distributed*"