docs: add the blueprint overview diagram #43
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
# ===================================================================================== # | |
# GitHub Actions configuration file for an AWS Glue ETL application # | |
# # | |
# This workflow will: # | |
# 1. Install dependencies, run tests and style checks with Python 3.10. # # | |
# 2. Copy the Glue scripts to an appropriate S3 bucket. # | |
# ===================================================================================== # | |
name: on PUSH to [main] | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- ".github/workflows/on-iac-*.yaml" | |
- "infrastructure/**" | |
jobs: | |
# ===================================================================================== # | |
# PYTHON TESTS AND STYLE CHECKS # | |
# ===================================================================================== # | |
python-test-and-style-check: | |
environment: production | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Otherwise, it will fail to push refs to the destination repo. | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" # Caches pip dependencies. | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install -r requirements-dev.txt | |
- name: Run unit tests with pytest | |
# pytest-coverage.txt is required to properly report coverage in README.md. | |
run: pytest | tee ./pytest-coverage.txt | |
- name: Run Black style check on source code | |
run: black --check ./src ./tests | |
- name: Run Flake8 linter | |
run: flake8 ./src ./tests | |
- name: Generate unit test coverage report | |
id: report-coverage | |
uses: MishaKav/pytest-coverage-comment@v1.1.43 | |
with: | |
hide-comment: true | |
junitxml-path: ./pytest-junit.xml | |
- name: Update README.md with coverage html | |
run: sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.report-coverage.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ./README.md | |
- name: Commit & Push changes to README.md | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: "docs: update coverage on README.md" | |
# ===================================================================================== # | |
# GLUE JOBS DEPLOYMENT # | |
# ===================================================================================== # | |
glue-jobs-deployment: | |
environment: production | |
needs: python-test-and-style-check | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GlueCICDGitHubActionsServiceRole | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Copy Glue scripts to S3 | |
run: aws s3 sync --delete ./src s3://${{ vars.GLUE_SCRIPTS_S3_BUCKET }} |