-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds base GitHub Actions * updates Terraform Actions * updates minimally required Terraform version to `0.12.20` because of `try`
- Loading branch information
Showing
6 changed files
with
159 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
|
||
name: "Code Quality: Terraform" | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
TERRAFORM_VERSION: 0.12.20 | ||
TERRAFORM_ACTIONS_COMMENT: true | ||
|
||
jobs: | ||
terraform: | ||
name: terraform | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Run `terraform fmt` | ||
uses: hashicorp/terraform-github-actions@master | ||
with: | ||
tf_actions_version: ${{ env.TERRAFORM_VERSION }} | ||
tf_actions_subcommand: fmt | ||
tf_actions_working_dir: '.' | ||
tf_actions_comment: ${{ env.TERRAFORM_ACTIONS_COMMENT }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run `terraform init` | ||
uses: hashicorp/terraform-github-actions@master | ||
with: | ||
tf_actions_version: ${{ env.TERRAFORM_VERSION }} | ||
tf_actions_subcommand: init | ||
tf_actions_working_dir: '.' | ||
tf_actions_comment: ${{ env.TERRAFORM_ACTIONS_COMMENT }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run `terraform validate` | ||
uses: hashicorp/terraform-github-actions@master | ||
with: | ||
tf_actions_version: ${{ env.TERRAFORM_VERSION }} | ||
tf_actions_subcommand: validate | ||
tf_actions_working_dir: '.' | ||
tf_actions_comment: ${{ env.TERRAFORM_ACTIONS_COMMENT }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
AWS_REGION: xx-xxxx-0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
|
||
name: Code Quality | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
PARENT_ORG: operatehappy | ||
META_PATH: dotfiles-org | ||
SELF_PATH: repository | ||
PYTHON_VERSION: 3.8 | ||
PYTHON_ARCH: x64 | ||
PRECOMMIT_CACHE_PATH: ".cache/pre-commit" | ||
PRECOMMIT_VERSION: 1.18.3 | ||
PRECOMMIT_CONFIG: ".pre-commit-config.yaml" | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
name: pre-commit | ||
|
||
steps: | ||
- name: Checkout Meta Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ env.PARENT_ORG }}/${{ env.META_PATH }} | ||
ref: master | ||
path: ${{ env.META_PATH }} | ||
fetch-depth: 1 | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
path: ${{ env.SELF_PATH }} | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: ${{ env.PYTHON_ARCH }} | ||
|
||
- name: Update and Restore pip Binaries Cache | ||
uses: actions/cache@v1 | ||
id: cache-pip-binaries | ||
with: | ||
path: "${{ env.pythonLocation }}/bin" | ||
key: "pip-binaries-${{ env.PYTHON_VERSION }}-${{ env.PRECOMMIT_VERSION }}" | ||
|
||
- name: Update and Restore pip Packages Cache | ||
uses: actions/cache@v1 | ||
id: cache-pip-packages | ||
with: | ||
path: "${{ env.pythonLocation }}/lib/python${{ env.PYTHON_VERSION }}/site-packages" | ||
key: "pip-packages-${{ env.PYTHON_VERSION }}-${{ env.PRECOMMIT_VERSION }}" | ||
|
||
- name: Update and Restore pre-commit Cache | ||
uses: actions/cache@v1 | ||
id: cache-precommit-hooks | ||
with: | ||
path: "~/${{ env.PRECOMMIT_CACHE_PATH }}" | ||
key: ${{ hashFiles(format('{0}/{1}/{2}', github.workspace, env.META_PATH, env.PRECOMMIT_CONFIG )) }} | ||
|
||
- name: Install `pre-commit` via `pip` | ||
run: | | ||
pip \ | ||
install "pre-commit==${{ env.PRECOMMIT_VERSION }}" | ||
shell: sh | ||
if: steps.cache-pip-binaries.outputs.cache-hit != 'true' && steps.cache-pip-packages.outputs.cache-hit != 'true' | ||
|
||
- name: Setup `pre-commit` | ||
run: | | ||
pre-commit \ | ||
install \ | ||
--config "${{ github.workspace }}${{ env.UPSTREAM_REP }}/${{ env.PRECOMMIT_CONFIG }}" | ||
shell: sh | ||
working-directory: "${{ github.workspace }}/${{ env.SELF_PATH }}" | ||
if: steps.cache-precommit.outputs.cache-hit != 'true' | ||
|
||
- name: Run `pre-commit` | ||
run: | | ||
pre-commit \ | ||
run \ | ||
--config "${{ github.workspace }}/${{ env.META_PATH }}/${{ env.PRECOMMIT_CONFIG }}" \ | ||
--all-files | ||
working-directory: "${{ github.workspace }}/${{ env.SELF_PATH }}" | ||
shell: sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
|
||
name: Repository Management | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
assign-pr-to-author: | ||
runs-on: ubuntu-latest | ||
name: assign-pr-to-author | ||
|
||
steps: | ||
- name: Assign Pull Request to Author | ||
uses: technote-space/assign-author@v1 | ||
if: github.event_name == 'pull_request' && github.event.action == 'opened' | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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
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