refactor without makefile #76
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
# This GitHub Workflow will run on every push to the repository | |
# and will test the Kargo codebase on a Kind Kubernetes cluster. | |
name: CI - Kargo on Kind | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "devcontainer/**" | |
- ".devcontainer/**" | |
- ".pulumi/**" | |
- ".talos/**" | |
- ".kube/**" | |
- "docs/**" | |
- "**.md" | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- "devcontainer/**" | |
- ".devcontainer/**" | |
- ".pulumi/**" | |
- ".talos/**" | |
- ".kube/**" | |
- "docs/**" | |
- "**.md" | |
schedule: | |
- cron: "0 2 * * *" | |
jobs: | |
ci-kargo-kind: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/containercraft/konductor:latest | |
options: --user root --security-opt seccomp=unconfined | |
steps: | |
- name: Set Workspace Permissions | |
id: chown-workspaces | |
env: | |
ACTIONS_STEP_DEBUG: true | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBEDIR: .kube | |
KUBECONFIG: .kube/config | |
run: | | |
set -x | |
#chown -R $(whoami):$(whoami) /__w $HOME | |
ip a | |
docker ps --all | |
ip a | |
- name: Checkout | |
uses: actions/checkout@v4 | |
id: checkout | |
with: | |
fetch-depth: 1 | |
- name: Create Kind Cluster | |
id: create-kind-kubernetes | |
env: | |
ACTIONS_STEP_DEBUG: true | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBEDIR: .kube | |
KUBECONFIG: .kube/config | |
run: | | |
set -x | |
direnv allow | |
mkdir -p ${KUBEDIR} && touch ${KUBECONFIG} && sudo chmod 600 ${KUBECONFIG} | |
#chown -R $(whoami):$(whoami) $KUBECONFIG | |
kind create cluster | |
#sudo kind create cluster --retain --config=hack/kind.yaml --kubeconfig $KUBECONFIG | |
docker ps --all | |
kubectl cluster-info --context kind-cilium --kubeconfig $KUBECONFIG | |
kubectl cluster-info --context kind-cilium --kubeconfig $KUBECONFIG | |
- id: pulumi-up | |
name: Deploy Pulumi IaC | |
env: | |
ACTIONS_STEP_DEBUG: true | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBECONFIG: .kube/config | |
run: | | |
set -x | |
direnv allow | |
pulumi login | |
pulumi install | |
pulumi stack select --create dev | |
pulumi config set kubernetes kind | |
pulumi up --refresh --skip-preview | |
- id: pulumi-destroy | |
name: Wait for Kind Kubernetes API to be Ready | |
env: | |
ACTIONS_STEP_DEBUG: false | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBECONFIG: .kube/config | |
run: | | |
pulumi down --skip-preview --refresh \ | |
|| PULUMI_K8S_DELETE_UNREACHABLE=true pulumi down --skip-preview --refresh | |
- name: Cleanup | |
id: clean-all | |
if: always() | |
run: | | |
direnv allow | |
make clean-all | |
env: | |
ACTIONS_STEP_DEBUG: false | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |