Skip to content

Commit

Permalink
Update test.yaml (#570)
Browse files Browse the repository at this point in the history
* chore: Update test.yaml to include branch filtering for pull requests and push events

* chore: Update test.yaml to include lazy loading for images

* chore: Install curl in test.yaml workflow

* chore: Update test.yaml to include lazy loading for images

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to include installation of curl for KSail

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to remove CPU and memory usage print statements

* chore: Update test.yaml

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use sudo for chmod command in KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Update test.yaml to use wget instead of curl for KSail installation

* chore: Remove dependency on longhorn in harbor.yaml
  • Loading branch information
devantler authored Jul 21, 2024
1 parent 912c3ad commit 41b70db
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
--tag=latest
flux create kustomization flux-system \
--source=OCIRepository/flux-system \
--path=${{ vars.PROD_FLUX_KUSTOMIZATION_PATH }} \
--path=clusters/homelab-prod/flux-system \
--prune=true
push-to-oci-prod:
runs-on: ubuntu-latest
Expand Down
43 changes: 25 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,45 @@ name: Test

on:
pull_request:
branches: [main]
# Added 'edited' temporarily, as there currently is no trigger for when the base branch is updated.
# https://github.com/orgs/community/discussions/64119
types: [opened, synchronize, reopened, ready_for_review, closed, edited]
branches: main
types:
- opened
- synchronize
- reopened
- ready_for_review
- closed
- edited
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
KSAIL_CLUSTER_NAME: homelab-ksail

jobs:
test:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.pull_request.title, '[DRAFT]') }}
runs-on: homelab
if: github.event.pull_request.draft == false
steps:
- name: 📑 Checkout
uses: actions/checkout@v4
- name: ⚙️ Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: ⚙️ Install wget
run: sudo apt-get install -y wget
- name: ⚙️ Install KSail
run: brew install devantler/formulas/ksail
- name: ⛴️ Provision cluster
run: |
ksail sops ${{ vars.KSAIL_CLUSTER_NAME }} --import "${{ secrets.KSAIL_SOPS_KEY }}"
ksail up ${{ vars.KSAIL_CLUSTER_NAME }}
- name: 🐎 Print free CPU
if: always()
run: |
top -bn2 | grep '%Cpu' | tail -1 | grep -P '(....|...) id,' | awk -v cores=$(nproc --all) '{print "CPU Usage: " 100-($8/cores) "% (" cores " cores)"}'
- name: 🧠 Print free memory
if: always()
sudo wget -qO /usr/local/bin/ksail "https://getbin.io/devantler/ksail?os=linux&arch=arm64"
sudo chmod +x /usr/local/bin/ksail
- name: ⛴️ Provision cluster
run: |
free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'
ksail sops ${{ env.KSAIL_CLUSTER_NAME }} --import "${{ secrets.KSAIL_SOPS_KEY }}"
ksail up ${{ env.KSAIL_CLUSTER_NAME }}
- name: 🔥 Teardown cluster
if: always()
run: ksail down ${{ vars.KSAIL_CLUSTER_NAME }}
run: ksail down ${{ env.KSAIL_CLUSTER_NAME }}
2 changes: 0 additions & 2 deletions k8s/manifests/infrastructure/harbor/harbor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ metadata:
spec:
interval: 1m
targetNamespace: harbor
dependsOn:
- name: longhorn
sourceRef:
kind: OCIRepository
name: oci-artifacts
Expand Down

0 comments on commit 41b70db

Please sign in to comment.