Skip to content

Commit

Permalink
Merge pull request #18 from edwardtheharris/3-add-gke-module
Browse files Browse the repository at this point in the history
add gke module

Closes #3
  • Loading branch information
edwardtheharris authored Apr 5, 2024
2 parents 45c30ba + 8b7c868 commit bf4865f
Show file tree
Hide file tree
Showing 26 changed files with 995 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ if [ -f "$HOME/.gnupg/aws/secret_access_key.gpg" ]; then
AWS_DEFAULT_REGION="us-west-2"
export AWS_DEFAULT_REGION
fi

if [ -f "$HOME/.config/gcloud/application_default_credentials.json" ]; then
GOOGLE_CREDENTIALS="$(cat "$HOME"/.config/gcloud/application_default_credentials.json)"
export GOOGLE_CREDENTIALS
fi
11 changes: 8 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches:
- main
pull_request:
branches: [ "main" ]
branches:
- main
schedule:
- cron: '17 13 * * 2'

jobs:
analyze:
name: Analyze
###
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
Expand All @@ -41,11 +44,13 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ ]
###
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
language:
- python

steps:
- name: Checkout repository
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Sonar Scan
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout the code
uses: actions/checkout@main
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Setup TFLint
uses: terraform-linters/setup-tflint@master
- name: Configure Python
run: |
set -x
pip3 install -U pip pipenv
pipenv requirements --dev > reqs
pip3 install -r reqs
pytest --cov --cov-report=xml
pylint --output-format=parseable --output=pylint.lint gke/*.py
sed -i -e "s/project_version/$(cat .version)-$(git rev-parse --short=6 HEAD)/g" sonar-project.properties
- name: Run TFLint
run: tflint --recursive -f json > tflint.json || true
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: run-${{ matrix.python-version }}

finish:
needs: sonarcloud
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v1
with:
parallel-finished: true
carryforward: "run-3.9,run-3.10,run-3.11,run-3.12"
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.terraform/
__pycache__/
.coverage
.terraform.lock.hcl
.terraform/
*.tfvars
*.xml
pylint.lint
pylint.out
tflint.json
69 changes: 69 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
- hooks:
- args:
- >-
markdown
- >-
document
- >-
--anchor=false
- >-
--escape=false
- >-
--output-file=README.md
- >-
./
id: terraform-docs-go
- args:
- >-
markdown
- >-
document
- >-
--anchor=false
- >-
--escape=false
- >-
--output-file=index.md
- >-
./aks
id: terraform-docs-go
- args:
- >-
markdown
- >-
document
- >-
--anchor=false
- >-
--escape=false
- >-
--output-file=index.md
- >-
./eks
id: terraform-docs-go
- args:
- >-
markdown
- >-
document
- >-
--anchor=false
- >-
--escape=false
- >-
--output-file=index.md
- >-
./gke
id: terraform-docs-go
repo: https://github.com/terraform-docs/terraform-docs
rev: v0.17.0
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pytest = "*"
pytest-cov = "*"
pylint = "*"
coveralls = "*"

[dev-packages]
Loading

0 comments on commit bf4865f

Please sign in to comment.