Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 16 additions & 2 deletions .github/RELEASE_DRAFTER.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,25 @@ categories:
- 'enhancement'
- title: 'Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: 'Documentation'
label: 'documentation'
- title: 'CI'
label: 'ci'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'feature'
- 'enhancement'
patch:
labels:
- 'ci'
- 'bug'
- 'documentation'
default: patch
change-template: '- $TITLE, by @$AUTHOR (#$NUMBER)'
template: |
# What's changed
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: pre-commit

on:
workflow_dispatch:
pull_request:
branches:
- main
- master

permissions:
contents: read

concurrency:
group: pre-commit-${{ github.ref }}
cancel-in-progress: false

env:
# renovate: datasource=github-releases depName=asdf-vm/asdf
ASDF_VERSION: 31e8c93004abd76253d186b8896785895069749b # v0.15.0 # pragma: allowlist secret

jobs:
pre-commit:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup ASDF
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2

- name: Cache ASDF
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: asdf-cache
with:
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
path: |
~/.asdf/installs
~/.asdf/plugins
~/.asdf/shims
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-

- name: Install ASDF
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
with:
asdf_branch: ${{ env.ASDF_VERSION }}

- name: Reshim installed ASDF tools
shell: bash
run: asdf reshim

- name: Cache pip
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip/
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install pip dependencies
run: pip install -r requirements.txt

- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for zizmor
43 changes: 0 additions & 43 deletions .github/workflows/pre-commit.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
name: Release Drafter

permissions:
contents: write
pull-requests: read
name: Release drafter

on:
push:
Expand All @@ -11,13 +7,21 @@ on:
- master

pull_request:
types: [opened, reopened, synchronize, labeled]
types:
- opened
- reopened
- synchronize
- labeled

permissions:
contents: write
pull-requests: read

jobs:
update_release_draft:
runs-on: ubuntu-latest
release-drafter:
runs-on: ubuntu-24.04
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
with:
config-name: RELEASE_DRAFTER.yml
env:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Renovate

on:
workflow_dispatch:
schedule:
- cron: 0 4 * * *

permissions: {}

jobs:
renovate:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Generate GitHub App token
id: lara-renovate-app-token
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
with:
app-id: ${{ secrets.LARA_RENOVATE_APP_ID }}
private-key: ${{ secrets.LARA_RENOVATE_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Renovate
uses: renovatebot/github-action@8ac70de2fe55752c573155866e30735411e3b61c # v41.0.22
env:
RENOVATE_REPOSITORIES: ${{ github.repository }}
RENOVATE_ONBOARDING: false
with:
token: ${{ steps.lara-renovate-app-token.outputs.token }}
96 changes: 96 additions & 0 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Template sync

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # every day at midnight

permissions: {}

concurrency:
group: pre-commit
cancel-in-progress: false

env:
# renovate: datasource=github-releases depName=asdf-vm/asdf
ASDF_VERSION: 31e8c93004abd76253d186b8896785895069749b # v0.15.0 # pragma: allowlist secret

jobs:
universal-addon:
if: github.repository != 'lablabs/terraform-aws-eks-universal-addon'
runs-on: ubuntu-24.04
steps:
- name: Generate GitHub App token
id: template-sync-app-token
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
with:
app-id: ${{ secrets.LARA_TEMPLATE_SYNC_APP_ID }}
private-key: ${{ secrets.LARA_TEMPLATE_SYNC_APP_PRIVATE_KEY }}
repositories: ${{ github.event.repository.name }}
owner: ${{ github.repository_owner }}

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.template-sync-app-token.outputs.token }} # needed for private repositories
persist-credentials: false

- name: Sync universal-addon template
uses: AndreasAugustin/actions-template-sync@bcb94410a4f1dffdfe5eaabc8234c3b8e76ebc5b # v2.5.1
with:
source_gh_token: ${{ steps.template-sync-app-token.outputs.token }}
source_repo_path: lablabs/terraform-aws-eks-universal-addon
upstream_branch: main

target_gh_token: ${{ steps.template-sync-app-token.outputs.token }}

git_remote_pull_params: --allow-unrelated-histories --squash --strategy=recursive --no-tags -X theirs

pr_labels: kind/sync
pr_branch_name_prefix: "feat/universal-addon-sync"
pr_title: "feat(sync): sync universal-addon changes"
pr_commit_msg: "feat(sync): sync universal-addon changes"

is_pr_cleanup: true

- name: Setup ASDF
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2

- name: Cache ASDF
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: asdf-cache
with:
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
path: |
~/.asdf/installs
~/.asdf/plugins
~/.asdf/shims
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-

- name: Install ASDF
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
with:
asdf_branch: ${{ env.ASDF_VERSION }}

- name: Reshim installed ASDF tools
shell: bash
run: asdf reshim

- name: Cache pip
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip/
key: ${{ runner.os }}-pip-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Update README.md
run: pre-commit run --show-diff-on-failure --color=always terraform_docs --all-files || true

- name: Commit and push README.md
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
add: README.md
message: "docs: update README.md"
54 changes: 30 additions & 24 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Terraform validate

permissions:
contents: read

on:
workflow_dispatch:
pull_request:
Expand All @@ -8,42 +11,45 @@ on:
- master

jobs:
versionExtract:
extract-version:
name: Extract min/max Terraform versions
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Extract Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@main
id: terraform-min-max
uses: clowdhaus/terraform-min-max@f489335873df04c3ce04b5e73f385a726d910039 # v1.3.2
with:
directory: .
outputs:
minVersion: ${{ steps.minMax.outputs.minVersion }}
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
minVersion: ${{ steps.terraform-min-max.outputs.minVersion }}
maxVersion: ${{ steps.terraform-min-max.outputs.maxVersion }}

terraform-validate:
runs-on: ubuntu-20.04
needs: versionExtract
runs-on: ubuntu-24.04
needs: extract-version
strategy:
matrix:
tf_ver:
- ${{ needs.versionExtract.outputs.minVersion }}
- ${{ needs.versionExtract.outputs.maxVersion }}

- ${{ needs.extract-version.outputs.minVersion }}
- ${{ needs.extract-version.outputs.maxVersion }}
steps:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.tf_ver }}

- name: Terraform Init
id: init
run: terraform init

- name: Terraform Validate
id: validate
run: terraform validate
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: ${{ matrix.tf_ver }}

- name: Terraform Init
run: terraform init

- name: Terraform Validate
run: terraform validate
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc

.terraform.lock.hcl
Loading
Loading