-
Notifications
You must be signed in to change notification settings - Fork 79
76 lines (72 loc) · 2.53 KB
/
cicd.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Python CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10.15"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip install wheel
chmod 777 ./setup.sh
./setup.sh
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Coveralls related steps
- name: Coverage with coveralls
run: |
python -m pip install coveralls
coverage run --source=kairon -m pytest tests/ --ignore tests/unit_test/augmentation/ --ignore stress_test/ --disable-warnings
- env:
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Submit to coveralls.io
run: |
coveralls --service=github
- name: Generate Sphinx files
run: |
python -m pip install -U sphinx
python -m pip install sphinx_rtd_theme
cd docs
# sphinx-quickstart
# set system_file=../system.yaml
export system_file=../system.yaml
export EMAIl_CONF=../email.yaml
make html
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
if: github.ref == 'refs/heads/master'
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Copy files to the website
if: github.ref == 'refs/heads/master'
run: |
aws s3 sync docs/_build/html s3://${{ secrets.S3_PATH }}
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true