-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (56 loc) · 2.21 KB
/
ci.yml
File metadata and controls
64 lines (56 loc) · 2.21 KB
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
# This is a basic workflow to help you get started with Actions
name: CI
# Triggers the workflow on push or pull request events
on:
push:
pull_request:
branches:
- master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
LintAndTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
cd package
echo "Installing requirements.txt and test_requirements.txt:"
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test_requirements.txt ]; then pip install -r test_requirements.txt; fi
- name: Lint with flake8
run: |
pwd
python -m pip install flake8
# stop the build if there are Python syntax errors or undefined names
# E722 bare 'except'
# W605 invalid escape sequence '\.'
# E501 line too long
# F841 local variable 'e' is assigned to but never used
python -m flake8 . --count --ignore=E722,W605,E501,F841 --exclude=*__init__.py,*tag_terraform_resources.py,*data_model.py --statistics --show-source
- name: Create package and install it
run: |
python -m pip install --upgrade pip
chmod +x ci_deploy.sh
./ci_deploy.sh
- name: Test unit tests with unittest
run: |
python -m unittest
- name: Test integration tests for package/tests/integration_tests
env:
GH_TOKEN_DEC: ${{ secrets.GH_TOKEN_DEC }}
CURRENT_BRANCH: ${{ env.BRANCH_NAME }}
AZURE_APPLICATION_KEY_DEC: ${{ secrets.AZURE_APPLICATION_KEY_DEC }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_APPLICATION_ID: ${{ secrets.AZURE_APPLICATION_ID }}
run: |
pwd
echo "1: ${{ env.BRANCH_NAME }}"
python -m unittest discover -p "package/tests/integration_tests/mock_api_based_tests/int_test_mock*.py"