-
Notifications
You must be signed in to change notification settings - Fork 447
129 lines (109 loc) · 3.72 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
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
123
124
125
126
127
128
129
name: Code Testing
on:
pull_request:
branches:
- main
paths: # Paths that may affect code quality
paths-ignore:
- ".github/**"
- 'docs/**'
- 'examples/**'
- '*.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 SuperDuperDB Project
run: |
# Install core and testsuite dependencies on the cached python environment.
python -m pip install .
python -m pip install -r deploy/installations/testenv_requirements.txt
- name: Install DevKit (docs, testing, etc)
run: |
make install_devkit
- name: Lint and type-check
run: |
make lint-and-type-check
- name: Unit Testing
run: |
make unit_testing pytest_arguments="--cov=superduperdb --cov-report=xml"
- name: Ext Testing
run: |
make ext_testing
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3.1.4
with:
env_vars: RUNNER_OS,PYTHON_VERSION
file: ./coverage.xml
fail_ci_if_error: false
name: codecov-umbrella
# ---------------------------------
# Integration Testing
# ---------------------------------
integration-testing:
needs: [ 'unit_testing' ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Docker Image
run: |
make build_sandbox
- name: Start Testing Environment
run: |
# Update hostnames
echo 127.0.0.1 mongodb | sudo tee -a /etc/hosts
# Run the integrated testing environment
make testenv_init
# To make sure that pytest etc. are installed in the container
docker exec testenv-sandbox-1 sh -c 'make install_devkit'
- name: Data-backend Testing
run: |
# Run the test-suite within the sandbox image from the test environment
docker exec testenv-sandbox-1 sh -c 'make databackend_testing'
- name: Smoke Testing
run: |
# This tests if the tests which run on
# Run the test-suite within the sandbox image from the test environment
docker exec testenv-sandbox-1 sh -c 'make smoke_testing'
- name: Shutdown Testing Environment
run: |
# Run the integrated testing environment
make testenv_shutdown