-
Notifications
You must be signed in to change notification settings - Fork 88
122 lines (101 loc) · 3.14 KB
/
test.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1
jobs:
test:
name: test / py ${{ matrix.python-version }} / notebook ${{ matrix.jupyter-version }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.9, "3.10", 3.11]
jupyter-version: ["6.3", "6.4", "6.*", "7.1", "7.*"]
runs-on: ubuntu-latest
# Can't use Minio official image because we can't specify the docker command in Github Actions
# https://github.521000.bestmunity/t5/GitHub-Actions/Job-service-command/m-p/33901
# https://github.521000.bestmunity/t5/GitHub-Actions/Specify-command-in-job-service-container/m-p/40616
services:
minio:
image: getfider/minio:0.0.2
# image: minio/minio:RELEASE.2018-06-29T02-11-29Z
# command: server /export
ports:
- 9000:9000
- 9001:9001
env:
MINIO_ACCESS_KEY: access-key
MINIO_SECRET_KEY: secret-key
volumes:
- /tmp/tmp-data:/data
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
# ------------------------------------------------------------------------
# Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
id: cached-python-env
with:
path: ${{ env.pythonLocation }}
key: >
python
${{ runner.os }}
python-${{ matrix.python-version }}
jupyter-${{ matrix.jupyter-version }}
${{ hashFiles('pyproject.toml') }}
${{ hashFiles('requirements/*') }}
- name: Install dependencies
if: steps.cached-python-env.outputs.cache-hit != 'true'
run: |
pip install -r requirements/all.txt
pip install -U notebook==${{ matrix.jupyter-version }}
- name: Install Hatch
run: |
pip install --upgrade hatch
- name: Print Python info
run: |
which python
python --version
which pip
pip --version
pip freeze
# ------------------------------------------------------------------------
# Build and test
- name: Verify Minio
run: |
sudo mkdir -p /tmp/tmp-data/notebooks
curl http://localhost:9000/
- name: Build package
run: hatch build
- name: Install package
run: |
pip install dist/*.tar.gz
pip freeze
- name: Run tests
run: |
pytest . -m "not gcs"
just report
- name: Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
- name: Upload test results to GitHub
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results-py${{ matrix.python-version }}
path: htmlcov