-
Notifications
You must be signed in to change notification settings - Fork 16
98 lines (83 loc) · 2.51 KB
/
ci-unit-tests.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
name: CI - RAGStack tests
on:
pull_request:
branches:
- main
concurrency:
group: ragstack-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker examples - basic
run: |
docker --version
cd docker/examples/basic
sudo docker build -t ragstack-basic .
- name: Docker examples - multistage
run: |
cd docker/examples/multistage
sudo docker build -t ragstack-multistage .
- name: Docker examples - local llm
run: |
cd docker/examples/local-llm
sudo docker build -t local-llm .
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: "Setup: Python 3.11"
uses: ./.github/actions/setup-python
- name: Run lint
uses: ./.github/actions/lint
- name: "Build"
run: |
tox -e build
- name: "Unit tests"
run: |
tox -e unit-tests
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: "Setup: Python 3.11"
uses: ./.github/actions/setup-python
- name: Compute db name
id: db-name
run: |
echo "db-name=${{ github.run_id}}-$(echo $(for((i=1;i<=8;i++))
do printf '%s' "${RANDOM:0:1}"; done) | tr '[0-9]' '[a-z]')" >> $GITHUB_OUTPUT
- name: Setup AstraDB
uses: ./.github/actions/setup-astra-db
id: astra-db
timeout-minutes: 10
with:
astra-token: ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}
db-name: ${{ steps.db-name.outputs.db-name }}
env: "DEV"
region: "us-west-2"
cloud: "aws"
- name: "Integration tests"
timeout-minutes: 10
env:
ASTRA_DB_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}"
ASTRA_DB_ID: "${{ steps.astra-db.outputs.db_id }}"
ASTRA_DB_ENV: "DEV"
run: |
rm -rf .tox
tox -e integration-tests
- name: Cleanup AstraDB
uses: ./.github/actions/cleanup-astra-db
if: ${{ always() }}
with:
astra-token: ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}
db-name: ${{ steps.db-name.outputs.db-name }}
env: "DEV"