-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.19 KB
/
ci-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
name: CI-Tests-New-File
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
paths:
# - './**'
- './terraform/**'
- './integration_tests/**'
env:
AWS_DEFAULT_REGION: 'eu-central-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACTIONS_STEP_DEBUG: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Debug Environment Variables
run: |
echo "BASE_DIR: $BASE_DIR"
echo "DATA_PATH: $DATA_PATH"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
working-directory: "./"
run: pip install -r requirements.txt
- name: Run Unit tests
working-directory: ./
run: pytest -vv -s ./tests/
# run: pytest -s .\tests\
- name: Lint
working-directory: "./"
run: pylint --recursive=y .
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Integration Test
working-directory: 'integraton-tests'
run: |
. run.sh
tf-plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Debug Environment Variables
run: |
echo "BASE_DIR: $BASE_DIR"
echo "DATA_PATH: $DATA_PATH"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
# - uses: hashicorp/setup-terraform@v1
- name: TF plan
working-directory: 'terraform'
run: |
terraform init -backend-config="key=mlops-zoomcamp-prod.tfstate" --reconfigure && terraform plan -var-file=vars/prod.tfvars