Skip to content

Merge pull request #12 from benitomartin/develop #6

Merge pull request #12 from benitomartin/develop

Merge pull request #12 from benitomartin/develop #6

Workflow file for this run

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 }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 -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: 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@v2
- name: TF plan
id: plan
working-directory: 'terraform'
run: |
terraform init -backend-config="key=mlops-zoomcamp-prod.tfstate" --reconfigure && terraform plan -var-file=C:\Users\bmart\OneDrive\11_MLOps\mlops-car-prices\terraform\vars\prod.tfvars