Skip to content

Commit ea92564

Browse files
authored
refactor(structure): universal-addon template migration (#3)
# Description <!-- Please include a summary of the change, provide a justification and which issue is fixed. --> ## Type of change - [ ] A bug fix (PR prefix `fix`) - [x] A new feature (PR prefix `feat`) - [ ] A code change that neither fixes a bug nor adds a feature (PR prefix `refactor`) - [ ] Adding missing tests or correcting existing tests (PR prefix `test`) - [ ] Changes that do not affect the meaning of the code like white-spaces, formatting, missing semi-colons, etc. (PR prefix `style`) - [ ] Changes to our CI configuration files and scripts (PR prefix `ci`) - [ ] Documentation only changes (PR prefix `docs`) This PR migrates addon structure to the https://github.com/lablabs/terraform-aws-eks-universal-addon template. ## How Has This Been Tested? <!-- Please describe the tests that you ran to verify your changes. --> Compared deployment behaviour with old and new version. Looking same. Compared CoreDNS configuration of old and new version. It is same.
1 parent 91ea866 commit ea92564

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2263
-1115
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Cache Warmup
2+
3+
on:
4+
push:
5+
branches:
6+
- main # caches from the main branch are shared with all other branches and pull requests
7+
8+
permissions: {}
9+
10+
env:
11+
# renovate: datasource=github-releases depName=asdf-vm/asdf
12+
ASDF_VERSION: 0.18.0
13+
14+
jobs:
15+
pre-commit:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
23+
- name: Setup ASDF
24+
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
25+
with:
26+
asdf_version: ${{ env.ASDF_VERSION }}
27+
28+
- name: Cache ASDF
29+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
30+
id: asdf-cache
31+
with:
32+
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
33+
path: |
34+
~/.asdf/installs
35+
~/.asdf/plugins
36+
~/.asdf/shims
37+
~/.cache/pip
38+
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}-warmup
39+
restore-keys: ${{ runner.os }}-asdf-
40+
41+
- name: Install ASDF
42+
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
43+
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
44+
with:
45+
asdf_version: ${{ env.ASDF_VERSION }}
46+
47+
- name: Cache pre-commit
48+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
49+
with:
50+
path: ~/.cache/pre-commit
51+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}-warmup
52+
restore-keys: ${{ runner.os }}-pre-commit-
53+
54+
- name: Run pre-commit
55+
run: pre-commit install --install-hooks
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for GH API calls quota

.github/workflows/pre-commit.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: pre-commit
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
- master
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: pre-commit-${{ github.ref }}
15+
cancel-in-progress: false
16+
17+
env:
18+
# renovate: datasource=github-releases depName=asdf-vm/asdf
19+
ASDF_VERSION: 0.18.0
20+
21+
jobs:
22+
pre-commit:
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
persist-credentials: false
29+
30+
- name: Setup ASDF
31+
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
32+
with:
33+
asdf_version: ${{ env.ASDF_VERSION }}
34+
35+
- name: Cache ASDF
36+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
37+
id: asdf-cache
38+
with:
39+
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
40+
path: |
41+
~/.asdf/installs
42+
~/.asdf/plugins
43+
~/.asdf/shims
44+
~/.cache/pip
45+
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
46+
restore-keys: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}-
47+
48+
- name: Install ASDF
49+
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
50+
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
51+
with:
52+
asdf_version: ${{ env.ASDF_VERSION }}
53+
54+
- name: Reshim installed ASDF tools
55+
shell: bash
56+
run: asdf reshim
57+
58+
- name: Cache pre-commit
59+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
60+
with:
61+
path: ~/.cache/pre-commit
62+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
63+
restore-keys: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}-
64+
65+
- name: Run pre-commit
66+
run: pre-commit run --show-diff-on-failure --color=always --all-files
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for GH API calls quota
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for zizmor

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/pull-request.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
semantic-title:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
types: |
23+
chore
24+
ci
25+
docs
26+
feat
27+
fix
28+
refactor
29+
style
30+
requireScope: true
31+
subjectPattern: "^.{0,120}$"

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Template sync
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *' # every day at midnight
7+
8+
permissions: {}
9+
10+
concurrency:
11+
group: pre-commit
12+
cancel-in-progress: false
13+
14+
env:
15+
# renovate: datasource=github-releases depName=asdf-vm/asdf
16+
ASDF_VERSION: 0.18.0
17+
18+
jobs:
19+
universal-addon:
20+
if: github.repository != 'lablabs/terraform-aws-eks-universal-addon'
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Generate GitHub App token
24+
id: template-sync-app-token
25+
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
26+
with:
27+
app-id: ${{ secrets.LARA_TEMPLATE_SYNC_APP_ID }}
28+
private-key: ${{ secrets.LARA_TEMPLATE_SYNC_APP_PRIVATE_KEY }}
29+
repositories: ${{ github.event.repository.name }}
30+
owner: ${{ github.repository_owner }}
31+
32+
- name: Checkout
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
with:
35+
token: ${{ steps.template-sync-app-token.outputs.token }} # needed for private repositories
36+
persist-credentials: false
37+
38+
- name: Sync universal-addon template
39+
uses: AndreasAugustin/actions-template-sync@8ec19a5f2721ffb81ff809aa340ddf75e6a85ea6 # v2.5.2
40+
with:
41+
source_gh_token: ${{ steps.template-sync-app-token.outputs.token }}
42+
source_repo_path: lablabs/terraform-aws-eks-universal-addon
43+
upstream_branch: main
44+
45+
target_gh_token: ${{ steps.template-sync-app-token.outputs.token }}
46+
47+
git_remote_pull_params: --allow-unrelated-histories --squash --strategy=recursive --no-tags -X theirs
48+
49+
pr_labels: kind/sync
50+
pr_branch_name_prefix: "feat/universal-addon-sync"
51+
pr_title: "feat(sync): sync universal-addon changes"
52+
pr_commit_msg: "feat(sync): sync universal-addon changes"
53+
54+
is_pr_cleanup: true
55+
56+
- name: Setup ASDF
57+
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
58+
with:
59+
asdf_version: ${{ env.ASDF_VERSION }}
60+
61+
- name: Cache ASDF
62+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
63+
id: asdf-cache
64+
with:
65+
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
66+
path: |
67+
~/.asdf/installs
68+
~/.asdf/plugins
69+
~/.asdf/shims
70+
~/.cache/pip
71+
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
72+
restore-keys: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}-
73+
74+
- name: Install ASDF
75+
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
76+
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
77+
with:
78+
asdf_version: ${{ env.ASDF_VERSION }}
79+
80+
- name: Reshim installed ASDF tools
81+
shell: bash
82+
run: asdf reshim
83+
84+
- name: Update README.md
85+
run: pre-commit run --show-diff-on-failure --color=always terraform_docs --all-files || true
86+
87+
- name: Commit and push README.md
88+
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
89+
with:
90+
add: README.md
91+
message: "docs: update README.md"

.github/workflows/validate.yaml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,45 @@ on:
1111
- master
1212

1313
jobs:
14-
versionExtract:
14+
extract-version:
1515
name: Extract min/max Terraform versions
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
persist-credentials: false
2123

2224
- name: Extract Terraform min/max versions
23-
id: minMax
24-
uses: clowdhaus/terraform-min-max@main
25+
id: terraform-min-max
26+
uses: clowdhaus/terraform-min-max@04440fe3b2a1e64eb5ad115f8f7c57c4d6a54333 # v1.4.1
2527
with:
2628
directory: .
2729
outputs:
28-
minVersion: ${{ steps.minMax.outputs.minVersion }}
29-
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
30+
minVersion: ${{ steps.terraform-min-max.outputs.minVersion }}
31+
maxVersion: ${{ steps.terraform-min-max.outputs.maxVersion }}
3032

3133
terraform-validate:
32-
runs-on: ubuntu-22.04
33-
needs: versionExtract
34+
runs-on: ubuntu-24.04
35+
needs: extract-version
3436
strategy:
3537
matrix:
3638
tf_ver:
37-
- ${{ needs.versionExtract.outputs.minVersion }}
38-
- ${{ needs.versionExtract.outputs.maxVersion }}
39-
39+
- ${{ needs.extract-version.outputs.minVersion }}
40+
- ${{ needs.extract-version.outputs.maxVersion }}
4041
steps:
41-
- uses: actions/checkout@v3
42-
- uses: hashicorp/setup-terraform@v2
43-
with:
44-
terraform_version: ${{ matrix.tf_ver }}
45-
46-
- name: Terraform Init
47-
id: init
48-
run: terraform init
49-
50-
- name: Terraform Validate
51-
id: validate
52-
run: terraform validate
42+
- name: Checkout
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
with:
45+
persist-credentials: false
46+
47+
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
48+
with:
49+
terraform_version: ${{ matrix.tf_ver }}
50+
51+
- name: Terraform Init
52+
run: terraform init
53+
54+
- name: Terraform Validate
55+
run: terraform validate

0 commit comments

Comments
 (0)