Merge pull request #599 from wri/develop #2745
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: Run tests and apply terraform changes for current branch | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Test with pytest | |
run: | | |
./scripts/test --do-cov --show-warnings | |
./scripts/test_v2 --no_build --do-cov --show-warnings | |
- name: Run codacy-coverage-reporter | |
uses: codacy/codacy-coverage-reporter-action@master | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: tests/cobertura.xml, tests_v2/cobertura.xml | |
- name: Run CodeCOV action | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: tests/cobertura.xml, tests_v2/cobertura.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
verbose: false | |
- name: Deploy production | |
if: success() && (github.ref_name == 'master') | |
env: | |
ENV: production | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_production }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_production }} | |
AWS_REGION: ${{ secrets.aws_region_production }} | |
run: | | |
./scripts/infra plan -w ${{ github.ref }} | |
./scripts/infra apply | |
- name: Deploy staging | |
if: success() && (github.ref_name == 'develop') | |
env: | |
ENV: staging | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_staging }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_staging }} | |
AWS_REGION: ${{ secrets.aws_region_staging }} | |
run: | | |
./scripts/infra plan -w ${{ github.ref }} | |
./scripts/infra apply | |
- name: Deploy dev | |
if: success() && (github.ref_name != 'develop') && (github.ref_name != 'master') | |
env: | |
ENV: dev | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_dev }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_dev }} | |
AWS_REGION: ${{ secrets.aws_region_dev }} | |
run: | | |
./scripts/infra plan -w ${{ github.ref }} | |
./scripts/infra apply |