From 8837368d43f1e2c9d101fc78e937663e0381dfe5 Mon Sep 17 00:00:00 2001 From: Benoit Garcia Date: Sun, 7 Jan 2024 01:27:23 +0100 Subject: [PATCH 1/5] chore: update dotfiles --- .editorconfig | 14 ++++++++++---- .gitignore | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3afc974..db7edc8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,13 +2,19 @@ # top-most EditorConfig file root = true +## Default settings [*] -# Unix-style newlines +### Unix-style newlines end_of_line = lf -# Always end with an empty new line +### Always end with an empty new line insert_final_newline = true -# Set default charset to utf-8 +### Set default charset to utf-8 charset = utf-8 -# Indent with 2 spaces +### Indent with 2 spaces indent_style = space indent_size = 2 + +## Markdown files +[*.md] +### Do not wrap long lines +max_line_length = off diff --git a/.gitignore b/.gitignore index 48ece5e..07ab2c1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ override.tf.json # to change depending on the environment. *.tfvars *.tfvars.json + +# MacOS File +**/.DS_Store From 1495b2ac726c4138101bcc1594e25de911ae69b4 Mon Sep 17 00:00:00 2001 From: Benoit Garcia Date: Sun, 7 Jan 2024 01:29:11 +0100 Subject: [PATCH 2/5] chore: configure yamllint --- .yamllint.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .yamllint.yaml diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..ad0d7d1 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,34 @@ +--- +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +rules: + anchors: enable + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: + level: warning + document-end: disable + document-start: + level: warning + empty-lines: enable + empty-values: disable + float-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: disable + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + level: warning From d90a628f8c42436c3399cb93f5d1730a098c07f8 Mon Sep 17 00:00:00 2001 From: Benoit Garcia Date: Sun, 7 Jan 2024 01:38:21 +0100 Subject: [PATCH 3/5] chore: fix yaml files syntax --- .github/dependabot.yml | 19 ++++++----- .github/workflows/pr-checks.yml | 57 +++++++++++++++++---------------- .terraform-docs.yaml | 1 + 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3de16aa..c53f0fb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,11 @@ +--- version: 2 updates: - -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - -- package-ecosystem: terraform - directory: "/" - schedule: - interval: daily + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + - package-ecosystem: terraform + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index ebb7098..73bc228 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -1,6 +1,7 @@ +--- name: Pull Request checks -on: +"on": pull_request: types: - opened @@ -13,39 +14,39 @@ jobs: name: Terraform Formatting runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: setup terraform - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 #v3.0.0 - - name: terraform fmt - run: terraform fmt -check -diff -recursive ./ + - name: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: setup terraform + uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 + - name: terraform fmt + run: terraform fmt -check -diff -recursive ./ terraform-validate: name: Terraform config validation runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: setup terraform - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 #v3.0.0 - - name: terraform init - run: terraform init - - name: terraform validate - run: terraform validate + - name: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: setup terraform + uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 + - name: terraform init + run: terraform init + - name: terraform validate + run: terraform validate tflint: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: cache tflint - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: ~/.tflint.d/plugins - key: tflint-${{ hashFiles('.tflint.hcl') }} - - name: setup tflint - uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0 - - name: tflint init - run: tflint --init - - name: tflint validate - run: tflint -f compact --module + - name: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: cache tflint + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + with: + path: ~/.tflint.d/plugins + key: tflint-${{ hashFiles('.tflint.hcl') }} + - name: setup tflint + uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0 + - name: tflint init + run: tflint --init + - name: tflint validate + run: tflint -f compact --module diff --git a/.terraform-docs.yaml b/.terraform-docs.yaml index aae6170..8358da8 100644 --- a/.terraform-docs.yaml +++ b/.terraform-docs.yaml @@ -1,3 +1,4 @@ +--- formatter: "markdown table" header-from: main.tf From 5301cd7d17a047422254dc8f87af2f671306453b Mon Sep 17 00:00:00 2001 From: Benoit Garcia Date: Sun, 7 Jan 2024 01:38:30 +0100 Subject: [PATCH 4/5] chore: fix yaml files extension --- .github/{dependabot.yml => dependabot.yaml} | 0 .github/workflows/{pr-checks.yml => pr-checks.yaml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{dependabot.yml => dependabot.yaml} (100%) rename .github/workflows/{pr-checks.yml => pr-checks.yaml} (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 100% rename from .github/dependabot.yml rename to .github/dependabot.yaml diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yaml similarity index 100% rename from .github/workflows/pr-checks.yml rename to .github/workflows/pr-checks.yaml From aa3029c427eb45bb4fca9f9184536ed2db1a6520 Mon Sep 17 00:00:00 2001 From: Benoit Garcia Date: Sun, 7 Jan 2024 01:39:39 +0100 Subject: [PATCH 5/5] chore: use shared workflows on pr --- .github/workflows/pr-checks.yaml | 52 -------------------------------- .github/workflows/pr.yaml | 22 ++++++++++++++ 2 files changed, 22 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/pr-checks.yaml create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml deleted file mode 100644 index 73bc228..0000000 --- a/.github/workflows/pr-checks.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: Pull Request checks - -"on": - pull_request: - types: - - opened - - reopened - - synchronize - - ready_for_review - -jobs: - terraform-fmt: - name: Terraform Formatting - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: setup terraform - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 - - name: terraform fmt - run: terraform fmt -check -diff -recursive ./ - - terraform-validate: - name: Terraform config validation - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: setup terraform - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 - - name: terraform init - run: terraform init - - name: terraform validate - run: terraform validate - - tflint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: cache tflint - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: ~/.tflint.d/plugins - key: tflint-${{ hashFiles('.tflint.hcl') }} - - name: setup tflint - uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0 - - name: tflint init - run: tflint --init - - name: tflint validate - run: tflint -f compact --module diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..43dee9a --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,22 @@ +--- +name: Pull Request checks + +"on": + pull_request: + branches: + - main + - master + types: + - opened + - reopened + - synchronize + - ready_for_review + +jobs: + check_shell: + uses: scaleway-terraform-modules/wokflows/.github/workflows/check_shell.yaml@6daf37405de395030ec647a50c4e1704628fda51 # v0.0.1 + check_tf: + uses: scaleway-terraform-modules/wokflows/.github/workflows/check_tf.yaml@6daf37405de395030ec647a50c4e1704628fda51 # v0.0.1 + secrets: inherit + check_yaml: + uses: scaleway-terraform-modules/wokflows/.github/workflows/check_yaml.yaml@6daf37405de395030ec647a50c4e1704628fda51 # v0.0.1