mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 16:09:08 +00:00
52561bd15d
* Add code-server env to values * Bump chart version * [common] - add ingressclass name (#441) * add ingressclassname Signed-off-by: Jon Baker <jonbaker85@gmail.com> * Allow disabling of service links * Update changelog * Update changelog * Set better default for targetPort * Allow for different container / service ports * Fix linting error * Add unit tests * Add unit tests * Add unit tests * Service unit tests * Split CI jobs * Testing CI * Testing CI * Testing CI * Testing CI * Rename test file to match source * Fix newline Co-authored-by: Jon Baker <jonbaker85@gmail.com> Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
111 lines
2.9 KiB
YAML
111 lines
2.9 KiB
YAML
name: Lint and Test Charts
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
changed: ${{ steps.list-changed.outputs.changed }}
|
|
common: ${{ steps.list-changed.outputs.common }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.4.0
|
|
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@v2.0.1
|
|
|
|
- name: Run chart-testing (list-changed)
|
|
id: list-changed
|
|
run: |
|
|
changed=$(ct list-changed --config .github/ct.yaml)
|
|
if [[ -n "$changed" ]]; then
|
|
echo "::set-output name=changed::true"
|
|
fi
|
|
|
|
changed_unfiltered=$(ct list-changed --config .github/ct.yaml --excluded-charts "")
|
|
if [[ $(grep -E "^charts/common(-test)?$" <<< "$changed_unfiltered") ]]; then
|
|
echo "::set-output name=common::true"
|
|
fi
|
|
|
|
- name: Run chart-testing (lint)
|
|
id: lint
|
|
run: ct lint --config .github/ct.yaml --excluded-charts ""
|
|
if: steps.list-changed.outputs.changed == 'true' || steps.list-changed.outputs.common == 'true'
|
|
|
|
unittest:
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Dev tools
|
|
run: sudo apt-get update && sudo apt-get install -y jq libjq-dev
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.4.0
|
|
|
|
- name: Install Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: 2.7
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
export RUBYJQ_USE_SYSTEM_LIBRARIES=1
|
|
bundle install
|
|
|
|
- name: Run tests
|
|
run: |
|
|
bundle exec m -r test/charts
|
|
|
|
install:
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.4.0
|
|
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@v2.0.1
|
|
|
|
- name: Create kind cluster
|
|
uses: helm/kind-action@v1.1.0
|
|
if: needs.lint.outputs.changed == 'true' || needs.lint.outputs.common == 'true'
|
|
|
|
- name: Run chart-testing (install)
|
|
run: ct install --config .github/ct.yaml
|
|
if: needs.lint.outputs.changed == 'true'
|
|
|
|
- name: Run chart-testing (common-test)
|
|
run: |
|
|
ct install --config .github/ct.yaml --charts 'charts/common-test'
|
|
if: needs.lint.outputs.common == 'true'
|