generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (62 loc) · 2.08 KB
/
test.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
71
72
name: run-unit-test-and-lint
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'Deliverables/**'
- 'Documentation/**'
- 'DummyData/**'
jobs:
unit-tests-and-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: |
pip install -r QAChat/Data_Processing/requirements.txt
pip install -r QAChat/QA_Bot/requirements.txt
pip install -r QAChat/Slack_Bot/requirements.txt
pip install -r Testing/requirements.txt
python -m spacy download xx_ent_wiki_sm
python -m spacy download de_core_news_sm
- name: Set PYTHONPATH
run: |
echo "PYTHONPATH=$(pwd):$(pwd)/amos2023ss03-qachat" >> $GITHUB_ENV
- name: Run unit tests
working-directory: ./Testing
env:
DEEPL_TOKEN: ${{ secrets.DEEPL_TOKEN}}
run: |
pytest -s qa_agent_unit_tests.py
pytest -s chunking_unit_tests.py
# - name: Run DB Test
# env:
# SUPABASE_URL: ${{ secrets.SUPABASE_URL}}
# SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY}}
#
# working-directory: ./Testing
# run: python db_integration_test.py
- name: Run autoformatting
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
black: true
auto_fix: true
- name: Commit and push if it was formatted
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git diff --exit-code --quiet && echo "No changes to commit" || (git add . && git commit -m "Format Python code with psf/black" && git push)