Merge pull request #15 from benitomartin/develop #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |