-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (62 loc) · 2.22 KB
/
github-workflows.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
name: python-backend-workflows
on:
pull_request:
types:
- opened
- closed
- synchronize
jobs:
# temporary
list-packages:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
echo "Finding package directories..."
PACKAGES=$(find . -maxdepth 1 -type d -exec test -e '{}/requirements.txt' \; -print | sed 's|^\./||' | jq -R . | jq -cs .)
echo "matrix=${PACKAGES}" >> $GITHUB_OUTPUT
# temporary
lint-test:
needs: list-packages
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.list-packages.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11.x"
cache: "pip"
- name: Install dependencies for ${{ matrix.package }}
run: |
if [ -f ${{ matrix.package }}/requirements.txt ]; then
python -m pip install --upgrade pip
pip install -r ${{ matrix.package }}/requirements.txt
fi
pip install ruff
- name: Lint with ruff (selected rules) in ${{ matrix.package }}
run: |
ruff check --output-format=github --select=E9,F63,F7,F82 --target-version=py311 ${{ matrix.package }}
ruff check --output-format=github --target-version=py311 ${{ matrix.package }}
- name: Test with unittest in ${{ matrix.package }}
run: |
cd ${{ matrix.package }}
python -m unittest discover -s tests
env:
LLAMAINDEX_DB_EMBED_MODEL_PARAMS: ${{ secrets.LLAMAINDEX_DB_EMBED_MODEL_PARAMS }}
LLAMAINDEX_DB_VECTOR_STORE_PARAMS: ${{ secrets.LLAMAINDEX_DB_VECTOR_STORE_PARAMS }}
LLAMAINDEX_DB_TRANS_PATHS: ${{ secrets.LLAMAINDEX_DB_TRANS_PATHS }}
markdown-check:
uses: ai-cfia/github-workflows/.github/workflows/workflow-markdown-check.yml@main
with:
config-file-path: ".mlc_config.json"
secrets: inherit
repo-standard:
uses: ai-cfia/github-workflows/.github/workflows/workflow-repo-standards-validation.yml@main
secrets: inherit