Skip to content

Commit 8115864

Browse files
authored
Merge pull request #54 from gruntwork-io/feat/updating-schema-using-oneof
feat: Updating schema using `oneof`
2 parents a4a8735 + 67fe818 commit 8115864

26 files changed

Lines changed: 1635 additions & 428 deletions

.circleci/config.yml

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

.github/workflows/base-test.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Base Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: Test (${{ matrix.os }})
9+
runs-on: ${{ matrix.os }}-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu, macos]
14+
env:
15+
MISE_PROFILE: cicd
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Use mise to install dependencies
22+
uses: jdx/mise-action@v3
23+
with:
24+
version: 2025.12.13
25+
experimental: true
26+
env:
27+
# Adding token here to reduce the likelihood of hitting rate limit issues.
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- id: go-cache-paths
31+
run: |
32+
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
33+
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
34+
35+
- name: Go Build Cache
36+
uses: actions/cache@v5
37+
with:
38+
path: ${{ steps.go-cache-paths.outputs.go-build }}
39+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}-${{ matrix.os }}-amd64
40+
41+
- name: Go Mod Cache
42+
uses: actions/cache@v5
43+
with:
44+
path: ${{ steps.go-cache-paths.outputs.go-mod }}
45+
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}-${{ matrix.os }}-amd64
46+
47+
- name: Install go-junit-report
48+
run: |
49+
go install github.com/jstemmer/go-junit-report@latest
50+
51+
- name: Run Tests
52+
id: run-tests
53+
run: |
54+
set -o pipefail
55+
go test -v ./... -timeout 45m | tee >(go-junit-report -set-exit-code > result.xml)
56+
shell: bash
57+
env:
58+
# Adding token here to reduce the likelihood of hitting rate limit issues.
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
# Use shorter temp path on macOS to avoid path length issues with Git worktrees.
61+
# Default /var/folders/.../T/ paths are too long for Git's path resolution.
62+
TMPDIR: ${{ matrix.os == 'macos' && '/tmp' || '' }}
63+
64+
- name: Upload Report (${{ matrix.os }})
65+
uses: actions/upload-artifact@v6
66+
with:
67+
name: test-report-${{ matrix.os }}
68+
path: result.xml
69+
70+
- name: Display Test Results (${{ matrix.os }})
71+
uses: mikepenz/action-junit-report@v6
72+
if: always()
73+
with:
74+
report_paths: result.xml
75+
detailed_summary: 'true'
76+
include_time_in_summary: 'true'
77+
group_suite: 'true'
78+

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Build binaries
9+
runs-on: ubuntu-latest
10+
env:
11+
MISE_PROFILE: cicd
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v6
16+
17+
- name: Use mise to install dependencies
18+
uses: jdx/mise-action@v3
19+
with:
20+
version: 2025.12.13
21+
experimental: true
22+
env:
23+
# Adding token here to reduce the likelihood of hitting rate limit issues.
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- id: go-cache-paths
27+
run: |
28+
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
29+
30+
- name: Go Build Cache
31+
uses: actions/cache@v5
32+
with:
33+
path: ${{ steps.go-cache-paths.outputs.go-build }}
34+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}-linux-amd64
35+
36+
- name: Run tidy
37+
run: |
38+
go mod tidy
39+
40+
- name: Build client binary
41+
working-directory: examples/client-server/client
42+
run: |
43+
mkdir -p bin
44+
go build -o bin/terragrunt-iac-engine-client \
45+
-ldflags "-X github.com/gruntwork-io/go-commons/version.Version=${{ github.ref_name }} -extldflags '-static'" \
46+
.
47+
48+
- name: Build server binary
49+
working-directory: examples/client-server/server
50+
run: |
51+
mkdir -p bin
52+
go build -o bin/terragrunt-iac-engine-server \
53+
-ldflags "-X github.com/gruntwork-io/go-commons/version.Version=${{ github.ref_name }} -extldflags '-static'" \
54+
.
55+
56+
- name: Upload client binary
57+
uses: actions/upload-artifact@v6
58+
with:
59+
name: terragrunt-iac-engine-client
60+
path: examples/client-server/client/bin/terragrunt-iac-engine-client
61+
62+
- name: Upload server binary
63+
uses: actions/upload-artifact@v6
64+
with:
65+
name: terragrunt-iac-engine-server
66+
path: examples/client-server/server/bin/terragrunt-iac-engine-server
67+

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
lint:
8+
uses: ./.github/workflows/lint.yml
9+
secrets: inherit
10+
11+
precommit:
12+
uses: ./.github/workflows/precommit.yml
13+
secrets: inherit
14+
15+
go_mod_tidy_check:
16+
uses: ./.github/workflows/go-mod-tidy-check.yml
17+
secrets: inherit
18+
19+
base_tests:
20+
needs: [lint, precommit, go_mod_tidy_check]
21+
uses: ./.github/workflows/base-test.yml
22+
permissions:
23+
contents: read
24+
checks: write
25+
secrets: inherit
26+
27+
build:
28+
needs: [lint, precommit, go_mod_tidy_check]
29+
uses: ./.github/workflows/build.yml
30+
secrets: inherit
31+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Go Mod Tidy Check
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
go-mod-tidy-check:
8+
name: Check go mod tidy
9+
runs-on: ubuntu-latest
10+
env:
11+
MISE_PROFILE: cicd
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v6
16+
17+
- name: Use mise to install dependencies
18+
uses: jdx/mise-action@v3
19+
with:
20+
version: 2025.12.13
21+
experimental: true
22+
env:
23+
# Adding token here to reduce the likelihood of hitting rate limit issues.
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- id: go-cache-paths
27+
run: |
28+
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
29+
30+
- name: Go Mod Cache
31+
uses: actions/cache@v5
32+
with:
33+
path: ${{ steps.go-cache-paths.outputs.go-mod }}
34+
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}-linux-amd64
35+
36+
- name: Run go mod tidy
37+
run: |
38+
go mod tidy
39+
40+
- name: Check for changes
41+
run: |
42+
if [ -n "$(git status --porcelain)" ]; then
43+
echo "::error::go mod tidy made changes to go.mod or go.sum"
44+
git diff
45+
exit 1
46+
fi
47+

0 commit comments

Comments
 (0)