Skip to content

Commit

Permalink
fix: updates
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Dec 31, 2024
1 parent 8b75a18 commit c31a003
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 56 deletions.
45 changes: 15 additions & 30 deletions .github/workflows/flux-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
brew-gh-api-token: "${{ steps.app-token.outputs.token }}"
stable: true

- name: Setup Workflow Tools
Expand All @@ -69,47 +68,33 @@ jobs:
shell: bash
run: uv pip install flux-local

# - name: Setup Workflow Tools
# uses: jdx/mise-action@v2
# env:
# GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
# with:
# mise_toml: |
# [tools]
# python = "3.12"
# "uv" = "latest"
# "pipx:flux-local" = "latest"
# "aqua:fluxcd/flux2" = "latest"
# "aqua:helm/helm" = "latest"
# "aqua:kubernetes-sigs/kustomize" = "latest"

- name: Diff Resources
shell: bash
run: >
flux-local diff ${{ matrix.resources }}
--unified 6
--path ${{ github.workspace }}/pull/kubernetes/main/flux
--path-orig ${{ github.workspace }}/default/kubernetes/main/flux
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
--limit-bytes 10000
--all-namespaces
--sources "home-kubernetes"
> diff.patch
--unified 6
--path ${{ github.workspace }}/pull/kubernetes/main/flux
--path-orig ${{ github.workspace }}/default/kubernetes/main/flux
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
--limit-bytes 10000
--all-namespaces
--sources "home-kubernetes"
--output-file diff.patch
- name: Generate Diff
id: diff
run: |
cat diff.patch;
{
echo 'diff<<EOF'
cat diff.patch
echo EOF
echo 'diff<<EOF'
cat diff.patch
echo EOF
} >> "$GITHUB_OUTPUT";
{
echo "### Diff"
echo '```diff'
cat diff.patch
echo '```'
echo "### Diff"
echo '```diff'
cat diff.patch
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- if: ${{ steps.diff.outputs.diff != '' }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/helm-repository-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
branches: ["main"]
paths: ["kubernetes/**/helmrelease.yaml"]

env:
HOMEBREW_NO_ANALYTICS: "1"

jobs:
sync:
name: Helm Repository Sync
Expand All @@ -36,6 +39,8 @@ jobs:

- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
stable: true

- name: Setup Workflow Tools
shell: bash
Expand Down
60 changes: 37 additions & 23 deletions .github/workflows/pre-pull-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
HOMEBREW_NO_ANALYTICS: "1"

jobs:
extract-images:
name: Extract Images
Expand All @@ -30,13 +33,6 @@ jobs:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"

- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Workflow Tools
shell: bash
run: brew install jo yq

- name: Checkout Default Branch
uses: actions/checkout@v4
with:
Expand All @@ -50,25 +46,41 @@ jobs:
token: "${{ steps.app-token.outputs.token }}"
path: pull

- name: Gather Images in Default Branch
uses: docker://ghcr.io/allenporter/flux-local:v6.1.1
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
args: >-
get cluster
--path /github/workspace/default/kubernetes/main/flux
--enable-images
--output yaml
--output-file default.yaml
stable: true

- name: Gather Images in Pull Request Branch
uses: docker://ghcr.io/allenporter/flux-local:v6.1.1
- name: Setup Workflow Tools
shell: bash
run: brew install jo yq

- name: Setup Python
uses: actions/setup-python@v5
with:
args: >-
get cluster
--path /github/workspace/pull/kubernetes/main/flux
--enable-images
--output yaml
--output-file pull.yaml
python-version: 3.12.x

- name: Install Python Dependencies
shell: bash
run: uv pip install flux-local

- name: Gather Images in Default Branch
shell: bash
run: >
flux-local get cluster
--path ${{ github.workspace }}/default/kubernetes/main/flux
--enable-images
--output yaml
--output-file default.yaml
- name: Gather Images in Pull Request Branch
shell: bash
run: >
flux-local get cluster
--path ${{ github.workspace }}/pull/kubernetes/main/flux
--enable-images
--output yaml
--output-file pull.yaml
- name: Filter Default Branch Results
shell: bash
Expand Down Expand Up @@ -105,6 +117,8 @@ jobs:
steps:
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
stable: true

- name: Setup Workflow Tools
shell: bash
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches: ["main"]
paths: [".github/workflows/schemas.yaml"]

env:
HOMEBREW_NO_ANALYTICS: "1"
UV_SYSTEM_PYTHON: "1"

jobs:
publish:
name: Schemas
Expand All @@ -32,23 +36,25 @@ jobs:

- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
stable: true

- name: Setup Workflow Tools
shell: bash
run: brew install kubectl
run: brew install kubectl uv

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: 3.12.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install Python Dependencies
run: pip install pyyaml
run: uv pip install pyyaml

- name: Download and run crd-extractor
shell: bash
Expand Down

0 comments on commit c31a003

Please sign in to comment.