Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test.yaml #570

Merged
merged 29 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
12713ec
chore: Update test.yaml to include branch filtering for pull requests…
devantler Jul 20, 2024
ff1ea3f
Merge branch 'main' into feature/test-pr
devantler Jul 20, 2024
90a507d
chore: Update test.yaml to include lazy loading for images
devantler Jul 20, 2024
6ff6138
chore: Install curl in test.yaml workflow
devantler Jul 20, 2024
5403412
chore: Update test.yaml to include lazy loading for images
devantler Jul 20, 2024
1b616ea
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
44850cf
chore: Update test.yaml to include installation of curl for KSail
devantler Jul 20, 2024
250c65d
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
ce99b07
chore: Update test.yaml to remove CPU and memory usage print statements
devantler Jul 20, 2024
0cb01cc
chore: Update test.yaml
devantler Jul 20, 2024
95b9a92
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
b74adc4
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
1eb5300
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
ad0d324
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
bfef168
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
1bd5f61
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
bce4cb1
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
553d72e
Update test.yaml to use wget instead of curl for KSail installation
devantler Jul 20, 2024
8d9f453
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
cdae5f0
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
9e37c64
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
943481b
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
adbac84
chore: Update test.yaml to use sudo for chmod command in KSail instal…
devantler Jul 20, 2024
28ac198
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
e992352
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
f243704
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
6b3f048
chore: Update test.yaml to use wget instead of curl for KSail install…
devantler Jul 20, 2024
018ad2a
Merge branch 'main' into feature/test-pr
devantler Jul 21, 2024
291caa6
chore: Remove dependency on longhorn in harbor.yaml
devantler Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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