feat: setup initial module #7
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: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
example: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write # Required by hetznercloud/tps-action | |
defaults: | |
run: | |
working-directory: example | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: opentofu/setup-opentofu@v1 | |
with: | |
tofu_version: v1.7.2 # renovate: datasource=github-releases depName=opentofu/opentofu | |
tofu_wrapper: false | |
- uses: yokawasa/[email protected] | |
with: | |
setup-tools: | | |
kubectl | |
skaffold | |
kubectl: v1.29.6 # renovate: datasource=github-releases depName=kubernetes/kubernetes | |
skaffold: v2.12.0 # renovate: datasource=github-releases depName=GoogleContainerTools/skaffold | |
- name: Setup k3sup | |
run: curl -sLS https://get.k3sup.dev | sh | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: test-app/go.mod | |
- uses: hetznercloud/tps-action@main | |
- name: Swap module source | |
run: sed -i -e 's|source = ".*"|source = "./.."|' main.tf | |
- name: Setup environment | |
run: make up | |
- name: Verify environment | |
run: | | |
source files/env.sh | |
kubectl wait --for=condition=Ready --all node | |
kubectl wait --for=condition=Available --all --all-namespaces deployment | |
kubectl wait --for=condition=Ready --all --all-namespaces pod | |
- name: Deploy test app | |
working-directory: test-app | |
run: | | |
source ../example/files/env.sh | |
skaffold run | |
kubectl wait --for=condition=Ready --all pod -l app=test-app | |
- name: Cleanup | |
if: always() | |
run: make down |