Merge pull request #22 from appvia/renovate/actions-setup-python-7.x #73
This file contains hidden or 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: Terraform | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| jobs: | |
| module-validation: | |
| uses: appvia/appvia-cicd-workflows/.github/workflows/terraform-module-validation.yml@201431e5550813748bf123734a627a747ac0db3e # main | |
| name: Module Validation | |
| with: | |
| working-directory: . | |
| python-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Dependencies | |
| run: | | |
| pip3 install black | |
| - name: Run code formatting | |
| run: | | |
| make format-python | |
| - name: Check for formatting changes | |
| run: | | |
| if [[ -n $(git status --porcelain) ]]; then | |
| echo "Code is not formatted. Please run 'make format-python' and commit the changes." | |
| exit 1 | |
| fi | |
| python-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Dependencies | |
| run: | | |
| pip3 install pytest boto3 | |
| - name: Run unit tests | |
| env: | |
| AWS_DEFAULT_REGION: "eu-west-2" | |
| run: | | |
| make python-tests |