Reorganize Documentation For a Better Learning Journey #1825
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths-ignore: | |
- "README.md" | |
push: | |
branches: | |
- main | |
- release/v* | |
paths-ignore: | |
- '.github/**' | |
- 'docs/**' | |
- 'examples/**' | |
- 'test/**' | |
workflow_dispatch: | |
jobs: | |
# ensure the code builds... | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
id: go | |
- name: Get dependencies | |
run: | | |
make deps | |
- name: Build | |
run: | | |
make build | |
- name: Version | |
run: | | |
make version | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: | | |
./build/ | |
# run acceptance tests | |
test: | |
name: Acceptance Tests | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
id: go | |
- name: Get dependencies | |
run: | | |
make deps | |
- 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 localstack demo tests | |
localstack: | |
name: "[localstack] ${{ matrix.demo-folder }}" | |
needs: build | |
runs-on: ubuntu-latest | |
services: | |
localstack: | |
image: localstack/localstack:1.4.0 | |
ports: | |
- 4566:4566 | |
- 4510-4559:4510-4559 | |
env: | |
SERVICES: s3, iam, lambda, dynamodb, sts, account, ec2 | |
DEBUG: 0 | |
DOCKER_HOST: unix:///var/run/docker.sock | |
AWS_ACCESS_KEY_ID: test | |
AWS_SECRET_ACCESS_KEY: test | |
AWS_DEFAULT_REGION: us-east-1 | |
AWS_REGION: us-east-1 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
strategy: | |
matrix: | |
demo-folder: | |
- demo-localstack | |
timeout-minutes: 20 | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: /usr/local/bin | |
- name: Set execute permissions on atmos | |
run: chmod +x /usr/local/bin/atmos | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Run tests for ${{ matrix.demo-folder }} | |
run: | | |
cd examples/${{ matrix.demo-folder }} | |
atmos test | |
# run k3s demo tests | |
k3s: | |
name: "[k3s] ${{ matrix.demo-folder }}" | |
needs: build | |
runs-on: ubuntu-latest | |
services: | |
server: | |
image: "rancher/k3s:latest" | |
ports: | |
- 6443:6443 # Kubernetes API Server | |
- 80:80 # Ingress controller port 80, localhost:8000 | |
- 443:443 # Ingress controller port 443, localhost:8443 | |
env: | |
K3S_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
K3S_KUBECONFIG_OUTPUT: /output/kubeconfig.yaml | |
K3S_KUBECONFIG_MODE: 666 | |
volumes: | |
- /var/lib/rancher/k3s | |
- ${{github.workspace}}/output:/output | |
- /run:/run | |
- /var/run:/var/run | |
options: >- | |
--name k3s-server | |
--privileged | |
--entrypoint /bin/k3s-server | |
--restart always | |
agent: | |
image: "rancher/k3s:latest" | |
env: | |
K3S_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
K3S_URL: https://k3s-server:6443 | |
volumes: | |
- /var/lib/rancher/k3s | |
- /run:/run | |
- /var/run:/var/run | |
options: >- | |
--name k3s-agent | |
--privileged | |
--entrypoint /bin/k3s-agent | |
--restart always | |
strategy: | |
matrix: | |
demo-folder: | |
- demo-helmfile | |
timeout-minutes: 20 | |
steps: | |
- name: Debug | |
run: | | |
ls -l ${{github.workspace}}/output | |
docker ps | |
for i in {1..30}; do | |
docker ps | |
docker logs --tail 100 k3s-server | |
docker logs --tail 100 k3s-agent | |
sleep 1 | |
done | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: /usr/local/bin | |
- name: Set execute permissions on atmos | |
run: chmod +x /usr/local/bin/atmos | |
- name: Install the Cloud Posse package repository | |
run: curl -1sLf 'https://dl.cloudsmith.io/public/cloudposse/packages/cfg/setup/bash.deb.sh' | sudo bash | |
- name: Install kubectl, helmfile, and helm | |
run: sudo apt-get -y install kubectl helmfile helm | |
- name: Install helm-diff plugin | |
run: helm plugin install https://github.com/databus23/helm-diff | |
- name: Write a default AWS profile to the AWS config file | |
run: | | |
mkdir -p ~/.aws | |
echo '[default]' > ~/.aws/config | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Run tests for ${{ matrix.demo-folder }} | |
run: | | |
cd examples/${{ matrix.demo-folder }} | |
atmos test | |
# run other demo tests | |
mock: | |
name: "[mock] ${{ matrix.demo-folder }}" | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
demo-folder: | |
- demo-atlantis | |
# - demo-component-manifest | |
- demo-component-versions | |
- demo-context | |
# - demo-custom-command | |
# - demo-json-validation | |
# - demo-opa-validation | |
# - demo-opentofu | |
# - demo-project | |
# - demo-stacks | |
# - demo-terraform | |
# - demo-terraform-overrides | |
# - demo-workflows | |
# - demo-yaml-anchors | |
# - demo-mock-architecture | |
# - demo-stack-templating | |
# - demo-multi-cloud | |
# - demo-vendoring | |
timeout-minutes: 20 | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: /usr/local/bin | |
- name: Set execute permissions on atmos | |
run: chmod +x /usr/local/bin/atmos | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Run tests for ${{ matrix.demo-folder }} | |
run: | | |
cd examples/${{ matrix.demo-folder }} | |
atmos test | |
# run other demo tests | |
lint: | |
name: "[lint] ${{ matrix.demo-folder }}" | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
demo-folder: | |
# - demo-component-manifest | |
- demo-context | |
# - demo-custom-command | |
# - demo-json-validation | |
# - demo-library | |
# - demo-localstack | |
# - demo-opa-validation | |
# - demo-opentofu | |
# - demo-project | |
# - demo-stacks | |
# - demo-terraform | |
# - demo-terraform-overrides | |
# - demo-workflows | |
# - demo-yaml-anchors | |
# - demo-mock-architecture | |
# - demo-stack-templating | |
# - demo-multi-cloud | |
timeout-minutes: 20 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Install Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: ${{ steps.config.outputs.terraform-version }} | |
terraform_wrapper: false | |
- name: Lint examples/${{ matrix.demo-folder }}/components/terraform | |
uses: reviewdog/action-tflint@v1 | |
with: | |
github_token: ${{ secrets.github_token }} | |
working_directory: examples/${{ matrix.demo-folder }}/components/terraform | |
flags: >- | |
--enable-rule=terraform_unused_declarations | |
--disable-rule=terraform_typed_variables | |
--minimum-failure-severity=warning | |
--recursive | |
--config=${{ github.workspace }}/examples/.tflint.hcl | |
fail_on_error: true |