Skip to content

Commit

Permalink
Merge branch 'main' into pulak/DEV-2688
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman authored Dec 26, 2024
2 parents 3ba74d8 + 02bbeb9 commit 40c0a4c
Show file tree
Hide file tree
Showing 182 changed files with 6,259 additions and 2,263 deletions.
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Order is important: the last matching pattern has the highest precedence

# These owners will be the default owners for everything
* @cloudposse/engineering @cloudposse/contributors
* @cloudposse/engineering

# Cloud Posse must review any changes to Makefiles
**/Makefile @cloudposse/engineering
Expand All @@ -15,10 +15,10 @@

# Cloud Posse must review any changes to standard context definition,
# but some changes can be rubber-stamped.
**/*.tf @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
README.yaml @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
**/*.tf @cloudposse/engineering @cloudposse/approvers
README.yaml @cloudposse/engineering @cloudposse/approvers
README.md @cloudposse/engineering @cloudposse/approvers
docs/*.md @cloudposse/engineering @cloudposse/approvers

# Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration
.github/mergify.yml @cloudposse/admins
Expand Down
38 changes: 38 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
extends: .github

shared:
# Automated pull requests from bot users
is_a_bot: &is_a_bot
- or:
- "author=github-actions[bot]"

# Default branches
is_default_branch: &is_default_branch
- or:
- "base=main"
- "base=master"

# It's not closed or merged
is_open: &is_open
- and:
- -merged
- -closed

pull_request_rules:
- name: Trigger workflow dispatch on PR synchronized by github-actions[bot]
conditions:
- and: *is_a_bot
- and: *is_open
- and: *is_default_branch

actions:
comment:
message: |
Triggering the workflow dispatch for preview build...
github_actions:
workflow:
dispatch:
- workflow: website-preview-build.yml
ref: "{{ pull_request.head.ref }}"
- workflow: test.yml
ref: "{{ pull_request.head.ref }}"
167 changes: 136 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,26 @@ jobs:
# ensure the code builds...
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: linux
- os: windows-latest
target: windows
- os: macos-latest
target: macos
runs-on: ${{ matrix.os }}
steps:
- name: Build
run: echo "Building on ${{ matrix.os }}"

- name: Add GNU tar to PATH (significantly faster than windows tar)
if: matrix.target == 'windows'
run: echo "C:\Program Files\Git\usr\bin" >> $Env:GITHUB_PATH

- name: Check out code into the Go module directory
uses: actions/checkout@v4

Expand All @@ -42,29 +59,77 @@ jobs:
- name: Build
run: |
make build
make build-${{ matrix.target }}
- name: Version
run: |
make version
make version-${{ matrix.target }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
name: build-artifacts-${{ matrix.target }}
path: |
./build/
# run acceptance tests
test:
name: Acceptance Tests
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flavor:
- { os: ubuntu-latest, target: linux }
- { os: windows-latest, target: windows }
- { os: macos-latest, target: macos }
timeout-minutes: 15
runs-on: ${{ matrix.flavor.os }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Add GNU tar to PATH (significantly faster than windows tar)
if: matrix.flavor.target == 'windows'
run: echo "C:\Program Files\Git\usr\bin" >> $Env:GITHUB_PATH

- name: Download build artifacts for ${{ matrix.flavor.target }}
uses: actions/download-artifact@v4
with:
name: build-artifacts-${{ matrix.flavor.target }}
path: ${{ github.workspace }}

- name: Add build artifacts directory to PATH for linux or macos
if: matrix.flavor.target == 'linux' || matrix.flavor.target == 'macos'
run: |
echo "${{ github.workspace }}" >> $GITHUB_PATH
chmod +x "${{ github.workspace }}/atmos"
- name: Add build artifacts directory to PATH for windows
if: matrix.flavor.target == 'windows'
shell: pwsh
run: |
$atmosPath = Join-Path ${{ github.workspace }} "atmos.exe"
if (-not (Test-Path $atmosPath)) {
throw "atmos.exe not found at: $atmosPath"
}
echo "${{ github.workspace }}" >> $Env:GITHUB_PATH
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false

- name: Check atmos.exe integrity
if: matrix.flavor.target == 'windows'
shell: pwsh
run: |
Write-Output "PATH=$Env:PATH"
Write-Output "PATHEXT=$Env:PATHEXT"
Get-ChildItem "${{ github.workspace }}"
Get-Command "${{ github.workspace }}\atmos.exe"
atmos version
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -77,17 +142,7 @@ jobs:
- name: Acceptance tests
timeout-minutes: 10
run: |
make testacc
release:
needs: test
if: github.event_name == 'push'
uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
with:
publish: false
format: binary
secrets: inherit
run: make testacc

docker:
name: "Docker Lint"
Expand Down Expand Up @@ -142,6 +197,7 @@ jobs:
- /var/run/docker.sock:/var/run/docker.sock

strategy:
fail-fast: false
matrix:
demo-folder:
- demo-localstack
Expand All @@ -151,7 +207,7 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
name: build-artifacts-linux
path: /usr/local/bin

- name: Set execute permissions on atmos
Expand Down Expand Up @@ -204,7 +260,7 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
name: build-artifacts-linux
path: /usr/local/bin

- name: Set execute permissions on atmos
Expand All @@ -231,11 +287,16 @@ jobs:
# run other demo tests
mock:
name: "[mock] ${{ matrix.demo-folder }}"
name: "[mock-${{ matrix.flavor.target}}] ${{ matrix.demo-folder }}"
needs: build
runs-on: ubuntu-latest
runs-on: ${{ matrix.flavor.os }}
strategy:
fail-fast: false
matrix:
flavor:
- { os: ubuntu-latest, target: linux }
- { os: windows-latest, target: windows }
- { os: macos-latest, target: macos }
demo-folder:
- demo-atlantis
# - demo-component-manifest
Expand All @@ -255,29 +316,60 @@ jobs:
# - demo-stack-templating
# - demo-multi-cloud
- demo-vendoring
- tests

timeout-minutes: 20
steps:
- name: Download build artifacts
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Add GNU tar to PATH (significantly faster than windows tar)
if: matrix.flavor.target == 'windows'
run: echo "C:\Program Files\Git\usr\bin" >> $Env:GITHUB_PATH

- name: Download build artifacts for ${{ matrix.flavor.target }}
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: /usr/local/bin
name: build-artifacts-${{ matrix.flavor.target }}
path: ${{ github.workspace }}

- name: Set execute permissions on atmos
run: chmod +x /usr/local/bin/atmos
- name: Add build artifacts directory to PATH for linux or macos
if: matrix.flavor.target == 'linux' || matrix.flavor.target == 'macos'
run: |
echo "${{ github.workspace }}" >> $GITHUB_PATH
chmod +x "${{ github.workspace }}/atmos"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Add build artifacts directory to PATH for windows
if: matrix.flavor.target == 'windows'
run: |
echo "${{ github.workspace }}" >> $Env:GITHUB_PATH
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false

- name: Run tests for ${{ matrix.demo-folder }}
- name: Run tests in ${{ matrix.demo-folder }} for ${{ matrix.flavor.target }}
working-directory: examples/${{ matrix.demo-folder }}
if: matrix.flavor.target == 'linux' || matrix.flavor.target == 'macos'
run: |
atmos test
- name: Check atmos.exe integrity
if: matrix.flavor.target == 'windows'
shell: pwsh
run: |
Write-Output "PATH=$Env:PATH"
Write-Output "PATHEXT=$Env:PATHEXT"
Get-ChildItem "${{ github.workspace }}"
Get-Command "${{ github.workspace }}\atmos.exe"
atmos version
- name: Run tests in ${{ matrix.demo-folder }} for ${{ matrix.flavor.target }}
working-directory: examples/${{ matrix.demo-folder }}
if: matrix.flavor.target == 'windows'
shell: pwsh
run: |
cd examples/${{ matrix.demo-folder }}
atmos test
# run other demo tests
Expand All @@ -286,6 +378,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
demo-folder:
# - demo-component-manifest
Expand All @@ -305,6 +398,8 @@ jobs:
# - demo-mock-architecture
# - demo-stack-templating
# - demo-multi-cloud
- quick-start-advanced
#- quick-start-simple

timeout-minutes: 20
steps:
Expand All @@ -328,14 +423,15 @@ jobs:
--minimum-failure-severity=warning
--recursive
--config=${{ github.workspace }}/examples/.tflint.hcl
fail_on_error: true
fail_level: error

# run other demo tests
validate:
name: "[validate] ${{ matrix.demo-folder }}"
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
demo-folder:
- demo-context
Expand All @@ -361,3 +457,12 @@ jobs:
"examples/${{ matrix.demo-folder }}/stacks/**/*.yml"
]
}
release:
needs: [test, lint, mock, k3s, localstack, docker, validate]
if: github.event_name == 'push'
uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
with:
publish: false
format: binary
secrets: inherit
Loading

0 comments on commit 40c0a4c

Please sign in to comment.