-
Notifications
You must be signed in to change notification settings - Fork 464
91 lines (78 loc) · 2.92 KB
/
ci_code.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
name: Code Testing
on:
pull_request:
branches:
- main
- '[0-9]+.[0-9]+'
paths: # Paths that may affect code quality
paths-ignore:
- "plugins/**"
- ".github/**"
- 'docs/**'
- '*.md'
- '*.rst'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# ---------------------------------
# Unit Testing
# ---------------------------------
unit_testing:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: ["3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Changelog Update
uses: tarides/changelog-check-action@v2
with:
changelog: CHANGELOG.md
#---------------------------------------------------
# Configuring Python environments.
#
# We cache both the pip packages and the installation dir.
# If the pyproject remains unchanged, we re-use the existing installation dir.
# If the pyproject has changed, we reinstall everything using the cached pip packages.
- name: Cache Pip Packages
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Cache Python Installation
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }} # Cache the whole python installation dir.
key: ${{ matrix.os }}_python-${{ matrix.python-version }}_${{ hashFiles('pyproject.toml', '*/pyproject.toml') }}
#---------------------------------------------------
- name: Install superduper-framework
run: |
# Install core and testsuite dependencies on the cached python environment.
python -m pip install '.[test]'
# TODO: We currently need a default plugin to run tests using MongoDB.
# Once the local file database is complete, we may need to update this section.
python -m pip install plugins/mongodb
python -m pip install plugins/openai
python -m pip install plugins/ibis
python -m pip install plugins/sqlalchemy
- name: Lint and type-check
run: |
make lint-and-type-check
- name: Unit Testing
run: |
make unit_testing pytest_arguments="--cov=superduper --cov-report=xml" SUPERDUPER_CONFIG=test/configs/default.yaml
make unit_testing pytest_arguments="--cov=superduper --cov-report=xml" SUPERDUPER_CONFIG=test/configs/sql.yaml
- name: Rest Server Testing
run: |
make rest_testing pytest_arguments="--cov=superduper --cov-report=xml" SUPERDUPER_CONFIG=test/configs/default.yaml
- name: Usecase Testing
run: |
cp -r templates/* superduper/templates/
make usecase_testing SUPERDUPER_CONFIG=test/configs/default.yaml
make usecase_testing SUPERDUPER_CONFIG=test/configs/sql.yaml