Skip to content

Commit

Permalink
Add pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovo committed May 30, 2024
1 parent 293b4ca commit 8b854ca
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -e

pushd () {
command pushd "$@" > /dev/null
}

popd () {
command popd "$@" > /dev/null
}

export pushd popd

root=$(pwd)
for i in $(ls -1 high/envs); do
pushd ./high/envs/$i
for f in $(ls .); do
if [[ ! -f $f ]]; then
continue
fi
p=$(cat $f | grep path | cut -d: -f 2 | tr -d ' ')
if [[ -e "$root/$p" ]]; then
pushd "../../../$p"
echo $p
kustomize build . > /dev/null
popd
fi
done
popd
done
14 changes: 14 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ jobs:
- name: Setup terraform docs
uses: draios/[email protected]

- name: Install arkade
if: ${{ ! ((github.event_name == 'push') && (github.ref == 'refs/heads/main')) }}
uses: alexellis/setup-arkade@v3
- uses: alexellis/arkade-get@master
if: ${{ ! ((github.event_name == 'push') && (github.ref == 'refs/heads/main')) }}
with:
kubectl: latest
helm: latest
kubeconform: latest
kustomize: latest
- uses: pre-commit/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check flux resources
shell: bash
run: .github/workflows/check.sh
3 changes: 2 additions & 1 deletion devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"fluxcd@latest",
"pre-commit@latest",
"[email protected]",
"packer@latest"
"packer@latest",
"kubeconform@latest"
],
"shell": {
"init_hook": [
Expand Down
48 changes: 48 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,54 @@
}
}
},
"kubeconform@latest": {
"last_modified": "2024-05-22T06:18:38Z",
"resolved": "github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e#kubeconform",
"source": "devbox-search",
"version": "0.6.6",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/w7dc87xibz03s6ax708g2q1xwy55hq5m-kubeconform-0.6.6",
"default": true
}
],
"store_path": "/nix/store/w7dc87xibz03s6ax708g2q1xwy55hq5m-kubeconform-0.6.6"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/azzxni29c33dxvdnzwm1v1rn7v2chnai-kubeconform-0.6.6",
"default": true
}
],
"store_path": "/nix/store/azzxni29c33dxvdnzwm1v1rn7v2chnai-kubeconform-0.6.6"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/v61b4wq0fc2jgansv296l4dd10m9s1j9-kubeconform-0.6.6",
"default": true
}
],
"store_path": "/nix/store/v61b4wq0fc2jgansv296l4dd10m9s1j9-kubeconform-0.6.6"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/wqv89hd72ca55mkgyy6j3cqjf0vix23w-kubeconform-0.6.6",
"default": true
}
],
"store_path": "/nix/store/wqv89hd72ca55mkgyy6j3cqjf0vix23w-kubeconform-0.6.6"
}
}
},
"packer@latest": {
"last_modified": "2024-05-22T06:18:38Z",
"resolved": "github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e#packer",
Expand Down

0 comments on commit 8b854ca

Please sign in to comment.