Skip to content

Commit

Permalink
Add check example
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandowner committed Nov 18, 2023
1 parent 02e9900 commit b42f352
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
74 changes: 74 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Check Example

on: [push]

jobs:
ingress-nginx:
runs-on: ubuntu-latest
name: Do snapshot ingress-nginx and create PR if snapshot changed
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update Snapshot
uses: jlandowner/helm-chartsnap-action@v1
id: helm-chartsnap-action
with:
chart: ingress-nginx
repo: https://kubernetes.github.io/ingress-nginx
values: example/remote/ingress-nginx.values.yaml
additional_args: "--namespace ingress-nginx --skip-tests"
update_snapshot: true

cilium:
runs-on: ubuntu-latest
name: Do snapshot cilium and create PR if snapshot changed
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update Snapshot
uses: jlandowner/helm-chartsnap-action@v1
id: helm-chartsnap-action
with:
chart: cilium
repo: https://helm.cilium.io
values: example/remote/cilium.values.yaml
additional_args: "--namespace kube-system"
update_snapshot: true

local:
runs-on: ubuntu-latest
name: Do snapshot cilium and create PR if snapshot changed
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update Snapshot
uses: jlandowner/helm-chartsnap-action@v1
id: helm-chartsnap-action
with:
chart: example/app1
values: example/app1/test/
continue-on-error: true

- name: OK if snapshot is changed
if: steps.helm-chartsnap-action.outcome == 'failure'
shell: bash
run: |
echo "snapshot changed"
- name: Fail if snapshot is not changed
if: steps.helm-chartsnap-action.outcome == 'success'
shell: bash
run: |
echo "snapshot not changed"; exit 1
2 changes: 1 addition & 1 deletion example/remote/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ all: ingress-nginx cilium

.PHONY: ingress-nginx
ingress-nginx:
helm chartsnap -c ingress-nginx -f ingress-nginx.values.yaml -- --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx
helm chartsnap -c ingress-nginx -f ingress-nginx.values.yaml -- --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --skip-tests

.PHONY: cilium
cilium:
Expand Down

0 comments on commit b42f352

Please sign in to comment.