From ca3cf760503c350fdb29bd0e9c0037317936a16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Bra=C5=84ski?= Date: Thu, 30 Jul 2020 17:30:46 +0200 Subject: [PATCH] Add github actions for precommit and lint --- .github/workflows/lint.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/pre-commit.yml | 14 ++++++++++++++ .pre-commit-config.yaml | 9 +++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b081799 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: lint + +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + + +jobs: + lint-readme: + name: readme + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: cloudposse/build-harness@0.38.0 + with: + entrypoint: /usr/bin/make + args: readme/lint + + super-linter: + name: superlinter + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Lint Code Base + uses: docker://github/super-linter:v3 + env: + VALIDATE_ALL_CODEBASE: false diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..f3602d4 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,14 @@ +name: cloudposse-terraform-workflow + +on: + pull_request: + push: + branches: [master] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + - uses: pre-commit/action@v2.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..992ee5f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml +- repo: git://github.com/antonbabenko/pre-commit-terraform + rev: v1.31.0 + hooks: + - id: terraform_fmt