Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pull Request CI

on: [pull_request, workflow_dispatch]

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
- name: Install dependencies
id: dependencies
run: |
make dev
- name: Unit Test with pytest
id: tests
run: |
make test
- name: Linting
id: lint
run: |
make pylint
tflint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout source code

- uses: actions/cache@v4
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}

- uses: terraform-linters/setup-tflint@v4
name: Setup TFLint
with:
tflint_version: v0.50.3

- name: Show version
run: tflint --version

- name: Init TFLint
run: tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ github.token }}
- name: Run TFLint
run: tflint -f compact
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ dev:
test:
PYTHONPATH=src/ pytest tests/

lint:
pylint:
flake8 src/ tests/

tflint:
tflint terraform/