* try adding some custom tooling for the job * polish tooling * more polish * process stable * setup scripting for incubator * Process incubator * setup script for dev * remove dev placeholder app * remove .test beta folder * fix some of the workflows and tooling * fix a testing bug * update doc generation to not create app-readme.md * remove an unneeded file * support multiple charts * adapt docs * adapt branch in docs
116 lines
3.1 KiB
YAML
116 lines
3.1 KiB
YAML
name: "Apps: test"
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
tags-ignore:
|
|
- '**'
|
|
paths:
|
|
- 'stable/**'
|
|
- '!stable/*.md'
|
|
- '!stable/README.md'
|
|
- '!stable/README.md.gotmpl'
|
|
- '!stable/app-readme.md'
|
|
- '!stable/app-readme.md.gotmpl'
|
|
- '!stable/docs/*'
|
|
- 'incubator/**'
|
|
- '!incubator/*.md'
|
|
- '!incubator/README.md'
|
|
- '!incubator/README.md.gotmpl'
|
|
- '!incubator/app-readme.md'
|
|
- '!incubator/app-readme.md.gotmpl'
|
|
- '!incubator/docs/*'
|
|
- 'dev/**'
|
|
- '!dev/*.md'
|
|
- '!dev/README.md'
|
|
- '!dev/README.md.gotmpl'
|
|
- '!dev/app-readme.md'
|
|
- '!dev/app-readme.md.gotmpl'
|
|
- '!dev/docs/*'
|
|
- '.github/workflows/apps.test.yaml'
|
|
- '.github/ct-install.yaml'
|
|
- '.github/ct-lint.yaml'
|
|
|
|
jobs:
|
|
changes:
|
|
name: Get changed Apps
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
matrix: "{\"app\": ${{ steps.reduce.outputs.apps }} }"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
list-files: json
|
|
filters: |
|
|
changed:
|
|
- 'stable/**'
|
|
- 'incubator/**'
|
|
- 'dev/**'
|
|
- run: echo '${{ toJson(steps.filter.outputs) }}' > changes.json
|
|
- id: reduce
|
|
run: |
|
|
APPS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>(?<first_directory>(?<root1>[\/]?)[^\/]+\/)(?<second_directory>(?<root2>[\/]?)[^\/]+)(?<extra_paths>.+))"; "\(.second_directory)") | unique' changes.json)
|
|
echo ::set-output name=apps::${APPS}
|
|
|
|
app-tests:
|
|
needs: [changes]
|
|
name: App Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix: ${{ fromJson(needs.changes.outputs.matrix) }}
|
|
fail-fast: false
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Prepare-Lint
|
|
id: prep-lint
|
|
run: |
|
|
if test -f "./stable/${{ matrix.app }}/Chart.yaml"; then
|
|
train="stable"
|
|
elif test -f "./incubator/${{ matrix.app }}/Chart.yaml"; then
|
|
train="incubator"
|
|
else
|
|
train="dev"
|
|
fi
|
|
echo ::set-output name=train::${train}
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.5.3
|
|
|
|
- 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 (lint)
|
|
id: lint
|
|
run: ct lint --config .github/ct-lint.yaml --charts '${{ steps.prep-lint.outputs.train }}/${{ matrix.app }}'
|
|
|
|
- name: Create k3d cluster
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
with:
|
|
version: v1.19
|
|
|
|
- name: Run chart-testing (install)
|
|
run: ct install --config .github/ct-install.yaml --charts '${{ steps.prep-lint.outputs.train }}/${{ matrix.app }}'
|
|
|
|
app-tests-complete:
|
|
needs: [app-tests]
|
|
name: Apps Test Complete
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: complete message
|
|
run: echo "App Tests Completed Successfully"
|