Skip to content

Commit

Permalink
chore(vector): Run CI on any changes (#374)
Browse files Browse the repository at this point in the history
Without this PRs that don't make changes to any charts don't pass CI.
I think the overhead of just testing all charts is fairly minimal.

Signed-off-by: Jesse Szwedko <[email protected]>
  • Loading branch information
jszwedko authored Feb 16, 2024
1 parent 9331e8c commit aef30be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
8 changes: 1 addition & 7 deletions .github/kubeval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ KUBEVAL_VERSION="0.16.1"
SCHEMA_LOCATION="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/" # Up-to-date fork of instrumenta/kubernetes-json-schema
OS=$(uname)

CHANGED_CHARTS=${CHANGED_CHARTS:-${1:-}}
if [ -n "$CHANGED_CHARTS" ];
then
CHART_DIRS=$CHANGED_CHARTS
else
CHART_DIRS=$(ls -d charts/*)
fi
CHART_DIRS="charts/vector charts/vector-aggregator charts/vector-agent"

# install kubeval
curl --silent --show-error --fail --location --output /tmp/kubeval.tar.gz https://github.com/instrumenta/kubeval/releases/download/v"${KUBEVAL_VERSION}"/kubeval-${OS}-amd64.tar.gz
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,8 @@ on:
pull_request:

jobs:
changed:
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo -n "Charts changed:"
echo "$changed"
echo "::set-output name=changed::$changed"
else
echo "PR without any chart changes - failing"
exit 1
fi
lint-chart:
runs-on: ubuntu-latest
needs:
- changed
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,8 +21,6 @@ jobs:

lint-docs:
runs-on: ubuntu-latest
needs:
- changed
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -65,8 +37,6 @@ jobs:
kubeval-chart:
runs-on: ubuntu-latest
needs:
- changed
strategy:
matrix:
# When changing versions here, check that the version exists at: https://github.com/yannh/kubernetes-json-schema and https://hub.docker.com/r/kindest/node/tags
Expand All @@ -91,7 +61,6 @@ jobs:
- name: Run kubeval
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
CHANGED_CHARTS: ${{needs.changed.outputs.charts}}
run: .github/kubeval.sh

install-chart:
Expand Down

0 comments on commit aef30be

Please sign in to comment.