TrueChartsClone/.github/workflows/apps.test.yaml

194 lines
6.8 KiB
YAML
Raw Normal View History

name: "Apps: Tests"
on:
pull_request:
branches:
- '**'
tags-ignore:
- '**'
2021-12-05 11:03:37 +00:00
paths:
2021-05-09 16:25:25 +00:00
- 'charts/**'
2021-07-01 09:17:31 +00:00
- '.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 }} }"
empty_matrix: ${{ steps.reduce.outputs.empty_matrix }}
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2
- uses: dorny/paths-filter@v2
id: filter
with:
list-files: json
filters: |
changed:
- 'charts/dev/**'
2021-05-09 16:27:07 +00:00
- 'charts/stable/**'
- 'charts/incubator/**'
2021-11-08 13:55:20 +00:00
- 'charts/dependency/**'
2021-05-09 16:27:07 +00:00
- 'charts/library/**'
- 'charts/core/**'
- 'charts/enterprise/**'
- 'charts/games/**'
- 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>[\/]?)[^\/]+\/)(?<third_directory>(?<root3>[\/]?)[^\/]+)(?<extra_paths>.+))"; "\(.third_directory)") | unique' changes.json)
echo ::set-output name=apps::${APPS}
2021-05-09 16:52:26 +00:00
if [ -z "${APPS[0]}" ]; then
echo "No Changed Apps"
echo "::set-output name=empty_matrix::true"
else
2021-05-09 16:47:43 +00:00
echo "Changed Apps: ${APPS[*]}"
echo "::set-output name=empty_matrix::false"
fi
app-tests:
needs: [changes]
if: ${{ needs.changes.outputs.empty_matrix == 'false' }}
name: App Tests
done (+42 squashed commit) (#1053) Squashed commit: [8058e6aba] 1 error left [b0157b252] 2 errors [7fa494907] 4 errors [03139391e] 6 failures, 4 errors [7f017ea23] 12 errors [3e9ad758d] 0 failures, 13 errors [e24a3cb3e] 3 failures, 13 errors [6edcaa655] 4 failures 14 errors [9623bda57] 6 failures, 13 errors [04c35c995] 4 failed 22 errors [5f5335c15] 9 failures [9a33540e2] down to 20 failures [0e7b73b49] remove old tests [5cc6d11b7] fixup the resources [8c508d45a] some more progress [4acef3c3b] some more work [85cdb5d06] some ports cleanup [1987ac2ec] lint before unit [6fa221789] enable unit tests [c212b695d] other name [b78594518] common test name fix [ef6597e79] indent [8cbcfb5e4] common test rename [1ca838c16] seperate common tests [ef052b022] create two seperate job for common testing [67eb0e9b3] use devcontainer for release shizzle [0c47c482b] make it a sudo [4d8900b16] force install jq [9660cdd47] try something else [e2b611917] bump common to run tests (to fix them) [277241bbf] only use the new devcontainer for the release tests for now... [9c7b68e0f] Revert "remove setup chart testing action" This reverts commit 6987914587a58ab5a52a05b836d60ef91f1619d5. [444914311] Revert "use integrated k3d" This reverts commit d9bcb2f35d154b0afe1eb851729c37789b6ba0ea. (+6 squashed commit) Squashed commit: [313446184] Revert "correct k3s version" This reverts commit 81fa8a43c41c2449b7411e0d59a3c2bbe0aef1ea. [41b4d4795] Revert "version name tryout" This reverts commit bbb8dcead9f9426872390b8f89b1fd0e661534bb. [b64df97a0] Revert "change version" This reverts commit 8080395dc80e606769ad9790b35d35fac4d1d3ed. [ed63220d4] Revert "use k3s kubectl" This reverts commit ea81735d939e838ad595835ea09b54bff817dd83. [6267a2908] Revert "use normal kubectl" This reverts commit 216d3799111d47f65dd20dd85ccb8fbc586a9c2b. [f48ddde73] Revert "try to set kubectl context" This reverts commit a5e8a532c5620e0d9d4cb7a53a371ba200265612. [a5e8a532c] try to set kubectl context [216d37991] use normal kubectl [ea81735d9] use k3s kubectl [8080395dc] change version [bbb8dcead] version name tryout [81fa8a43c] correct k3s version [d9bcb2f35] use integrated k3d [698791458] remove setup chart testing action [5bd7cf01d] bump common-test
2021-09-28 22:11:52 +00:00
runs-on: ubuntu-20.04
strategy:
matrix: ${{ fromJson(needs.changes.outputs.matrix) }}
fail-fast: false
steps:
##
# GENERAL SECTION
##
- name: Checkout
if: ${{ matrix.app != '.gitkee' }}
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2
with:
fetch-depth: 0
- name: Cache helm repo cache
2021-08-17 12:10:04 +00:00
id: cache
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # renovate: tag=v2
with:
2021-08-17 11:46:19 +00:00
key: helmrepocache-${{ github.sha }}
path: |
~/.cache/helm/repository
~/.config/helm/repositories.yaml
- name: Prepare-Lint
if: ${{ matrix.app != '.gitkee' }}
id: prep-lint
run: |
if test -f "./charts/incubator/${{ matrix.app }}/Chart.yaml"; then
train="incubator"
2021-09-03 10:16:39 +00:00
elif test -f "./charts/stable/${{ matrix.app }}/Chart.yaml"; then
train="stable"
elif test -f "./charts/library/${{ matrix.app }}/Chart.yaml"; then
train="library"
elif test -f "./charts/dev/${{ matrix.app }}/Chart.yaml"; then
train="dev"
2021-11-08 13:55:20 +00:00
elif test -f "./charts/dependency/${{ matrix.app }}/Chart.yaml"; then
train="dependency"
elif test -f "./charts/core/${{ matrix.app }}/Chart.yaml"; then
train="core"
elif test -f "./charts/games/${{ matrix.app }}/Chart.yaml"; then
train="games"
elif test -f "./charts/enterprise/${{ matrix.app }}/Chart.yaml"; then
train="enterprise"
else
2021-08-23 19:32:52 +00:00
train="incubator"
fi
echo ::set-output name=train::${train}
if test -f "./charts/${train}/${{ matrix.app }}/SKIPINSTALL"; then
install='false'
echo "::set-output name=install::false"
else
install="true"
echo "::set-output name=install::true"
fi
sudo groupadd apps -g 568
sudo useradd apps -u 568 -g 568 -d /home/apps -s /bin/bash
done (+42 squashed commit) (#1053) Squashed commit: [8058e6aba] 1 error left [b0157b252] 2 errors [7fa494907] 4 errors [03139391e] 6 failures, 4 errors [7f017ea23] 12 errors [3e9ad758d] 0 failures, 13 errors [e24a3cb3e] 3 failures, 13 errors [6edcaa655] 4 failures 14 errors [9623bda57] 6 failures, 13 errors [04c35c995] 4 failed 22 errors [5f5335c15] 9 failures [9a33540e2] down to 20 failures [0e7b73b49] remove old tests [5cc6d11b7] fixup the resources [8c508d45a] some more progress [4acef3c3b] some more work [85cdb5d06] some ports cleanup [1987ac2ec] lint before unit [6fa221789] enable unit tests [c212b695d] other name [b78594518] common test name fix [ef6597e79] indent [8cbcfb5e4] common test rename [1ca838c16] seperate common tests [ef052b022] create two seperate job for common testing [67eb0e9b3] use devcontainer for release shizzle [0c47c482b] make it a sudo [4d8900b16] force install jq [9660cdd47] try something else [e2b611917] bump common to run tests (to fix them) [277241bbf] only use the new devcontainer for the release tests for now... [9c7b68e0f] Revert "remove setup chart testing action" This reverts commit 6987914587a58ab5a52a05b836d60ef91f1619d5. [444914311] Revert "use integrated k3d" This reverts commit d9bcb2f35d154b0afe1eb851729c37789b6ba0ea. (+6 squashed commit) Squashed commit: [313446184] Revert "correct k3s version" This reverts commit 81fa8a43c41c2449b7411e0d59a3c2bbe0aef1ea. [41b4d4795] Revert "version name tryout" This reverts commit bbb8dcead9f9426872390b8f89b1fd0e661534bb. [b64df97a0] Revert "change version" This reverts commit 8080395dc80e606769ad9790b35d35fac4d1d3ed. [ed63220d4] Revert "use k3s kubectl" This reverts commit ea81735d939e838ad595835ea09b54bff817dd83. [6267a2908] Revert "use normal kubectl" This reverts commit 216d3799111d47f65dd20dd85ccb8fbc586a9c2b. [f48ddde73] Revert "try to set kubectl context" This reverts commit a5e8a532c5620e0d9d4cb7a53a371ba200265612. [a5e8a532c] try to set kubectl context [216d37991] use normal kubectl [ea81735d9] use k3s kubectl [8080395dc] change version [bbb8dcead] version name tryout [81fa8a43c] correct k3s version [d9bcb2f35] use integrated k3d [698791458] remove setup chart testing action [5bd7cf01d] bump common-test
2021-09-28 22:11:52 +00:00
- name: Install Helm
if: ${{ matrix.app != '.gitkee' }}
uses: azure/setup-helm@18bc76811624f360dbd7f18c2d4ecb32c7b87bab # renovate: tag=v1
done (+42 squashed commit) (#1053) Squashed commit: [8058e6aba] 1 error left [b0157b252] 2 errors [7fa494907] 4 errors [03139391e] 6 failures, 4 errors [7f017ea23] 12 errors [3e9ad758d] 0 failures, 13 errors [e24a3cb3e] 3 failures, 13 errors [6edcaa655] 4 failures 14 errors [9623bda57] 6 failures, 13 errors [04c35c995] 4 failed 22 errors [5f5335c15] 9 failures [9a33540e2] down to 20 failures [0e7b73b49] remove old tests [5cc6d11b7] fixup the resources [8c508d45a] some more progress [4acef3c3b] some more work [85cdb5d06] some ports cleanup [1987ac2ec] lint before unit [6fa221789] enable unit tests [c212b695d] other name [b78594518] common test name fix [ef6597e79] indent [8cbcfb5e4] common test rename [1ca838c16] seperate common tests [ef052b022] create two seperate job for common testing [67eb0e9b3] use devcontainer for release shizzle [0c47c482b] make it a sudo [4d8900b16] force install jq [9660cdd47] try something else [e2b611917] bump common to run tests (to fix them) [277241bbf] only use the new devcontainer for the release tests for now... [9c7b68e0f] Revert "remove setup chart testing action" This reverts commit 6987914587a58ab5a52a05b836d60ef91f1619d5. [444914311] Revert "use integrated k3d" This reverts commit d9bcb2f35d154b0afe1eb851729c37789b6ba0ea. (+6 squashed commit) Squashed commit: [313446184] Revert "correct k3s version" This reverts commit 81fa8a43c41c2449b7411e0d59a3c2bbe0aef1ea. [41b4d4795] Revert "version name tryout" This reverts commit bbb8dcead9f9426872390b8f89b1fd0e661534bb. [b64df97a0] Revert "change version" This reverts commit 8080395dc80e606769ad9790b35d35fac4d1d3ed. [ed63220d4] Revert "use k3s kubectl" This reverts commit ea81735d939e838ad595835ea09b54bff817dd83. [6267a2908] Revert "use normal kubectl" This reverts commit 216d3799111d47f65dd20dd85ccb8fbc586a9c2b. [f48ddde73] Revert "try to set kubectl context" This reverts commit a5e8a532c5620e0d9d4cb7a53a371ba200265612. [a5e8a532c] try to set kubectl context [216d37991] use normal kubectl [ea81735d9] use k3s kubectl [8080395dc] change version [bbb8dcead] version name tryout [81fa8a43c] correct k3s version [d9bcb2f35] use integrated k3d [698791458] remove setup chart testing action [5bd7cf01d] bump common-test
2021-09-28 22:11:52 +00:00
with:
version: v3.7.1
done (+42 squashed commit) (#1053) Squashed commit: [8058e6aba] 1 error left [b0157b252] 2 errors [7fa494907] 4 errors [03139391e] 6 failures, 4 errors [7f017ea23] 12 errors [3e9ad758d] 0 failures, 13 errors [e24a3cb3e] 3 failures, 13 errors [6edcaa655] 4 failures 14 errors [9623bda57] 6 failures, 13 errors [04c35c995] 4 failed 22 errors [5f5335c15] 9 failures [9a33540e2] down to 20 failures [0e7b73b49] remove old tests [5cc6d11b7] fixup the resources [8c508d45a] some more progress [4acef3c3b] some more work [85cdb5d06] some ports cleanup [1987ac2ec] lint before unit [6fa221789] enable unit tests [c212b695d] other name [b78594518] common test name fix [ef6597e79] indent [8cbcfb5e4] common test rename [1ca838c16] seperate common tests [ef052b022] create two seperate job for common testing [67eb0e9b3] use devcontainer for release shizzle [0c47c482b] make it a sudo [4d8900b16] force install jq [9660cdd47] try something else [e2b611917] bump common to run tests (to fix them) [277241bbf] only use the new devcontainer for the release tests for now... [9c7b68e0f] Revert "remove setup chart testing action" This reverts commit 6987914587a58ab5a52a05b836d60ef91f1619d5. [444914311] Revert "use integrated k3d" This reverts commit d9bcb2f35d154b0afe1eb851729c37789b6ba0ea. (+6 squashed commit) Squashed commit: [313446184] Revert "correct k3s version" This reverts commit 81fa8a43c41c2449b7411e0d59a3c2bbe0aef1ea. [41b4d4795] Revert "version name tryout" This reverts commit bbb8dcead9f9426872390b8f89b1fd0e661534bb. [b64df97a0] Revert "change version" This reverts commit 8080395dc80e606769ad9790b35d35fac4d1d3ed. [ed63220d4] Revert "use k3s kubectl" This reverts commit ea81735d939e838ad595835ea09b54bff817dd83. [6267a2908] Revert "use normal kubectl" This reverts commit 216d3799111d47f65dd20dd85ccb8fbc586a9c2b. [f48ddde73] Revert "try to set kubectl context" This reverts commit a5e8a532c5620e0d9d4cb7a53a371ba200265612. [a5e8a532c] try to set kubectl context [216d37991] use normal kubectl [ea81735d9] use k3s kubectl [8080395dc] change version [bbb8dcead] version name tryout [81fa8a43c] correct k3s version [d9bcb2f35] use integrated k3d [698791458] remove setup chart testing action [5bd7cf01d] bump common-test
2021-09-28 22:11:52 +00:00
- name: update helm repo cache
run: |
helm repo add truecharts https://truecharts.org
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add metallb https://metallb.github.io/metallb
helm repo add grafana https://grafana.github.io/helm-charts
2021-11-21 21:37:45 +00:00
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add amd-gpu-helm https://radeonopencompute.github.io/k8s-device-plugin/
helm repo update
- uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3
done (+42 squashed commit) (#1053) Squashed commit: [8058e6aba] 1 error left [b0157b252] 2 errors [7fa494907] 4 errors [03139391e] 6 failures, 4 errors [7f017ea23] 12 errors [3e9ad758d] 0 failures, 13 errors [e24a3cb3e] 3 failures, 13 errors [6edcaa655] 4 failures 14 errors [9623bda57] 6 failures, 13 errors [04c35c995] 4 failed 22 errors [5f5335c15] 9 failures [9a33540e2] down to 20 failures [0e7b73b49] remove old tests [5cc6d11b7] fixup the resources [8c508d45a] some more progress [4acef3c3b] some more work [85cdb5d06] some ports cleanup [1987ac2ec] lint before unit [6fa221789] enable unit tests [c212b695d] other name [b78594518] common test name fix [ef6597e79] indent [8cbcfb5e4] common test rename [1ca838c16] seperate common tests [ef052b022] create two seperate job for common testing [67eb0e9b3] use devcontainer for release shizzle [0c47c482b] make it a sudo [4d8900b16] force install jq [9660cdd47] try something else [e2b611917] bump common to run tests (to fix them) [277241bbf] only use the new devcontainer for the release tests for now... [9c7b68e0f] Revert "remove setup chart testing action" This reverts commit 6987914587a58ab5a52a05b836d60ef91f1619d5. [444914311] Revert "use integrated k3d" This reverts commit d9bcb2f35d154b0afe1eb851729c37789b6ba0ea. (+6 squashed commit) Squashed commit: [313446184] Revert "correct k3s version" This reverts commit 81fa8a43c41c2449b7411e0d59a3c2bbe0aef1ea. [41b4d4795] Revert "version name tryout" This reverts commit bbb8dcead9f9426872390b8f89b1fd0e661534bb. [b64df97a0] Revert "change version" This reverts commit 8080395dc80e606769ad9790b35d35fac4d1d3ed. [ed63220d4] Revert "use k3s kubectl" This reverts commit ea81735d939e838ad595835ea09b54bff817dd83. [6267a2908] Revert "use normal kubectl" This reverts commit 216d3799111d47f65dd20dd85ccb8fbc586a9c2b. [f48ddde73] Revert "try to set kubectl context" This reverts commit a5e8a532c5620e0d9d4cb7a53a371ba200265612. [a5e8a532c] try to set kubectl context [216d37991] use normal kubectl [ea81735d9] use k3s kubectl [8080395dc] change version [bbb8dcead] version name tryout [81fa8a43c] correct k3s version [d9bcb2f35] use integrated k3d [698791458] remove setup chart testing action [5bd7cf01d] bump common-test
2021-09-28 22:11:52 +00:00
if: ${{ matrix.app != '.gitkee' }}
with:
python-version: 3.7
- name: Set up chart-testing
if: ${{ matrix.app != '.gitkee' }}
uses: helm/chart-testing-action@6b64532d456fa490a3da177fbd181ac4c8192b58 # renovate: tag=v2.2.0
##
# Chart-Testing Section
##
- name: Run chart-testing (lint)
done (+42 squashed commit) (#1053) Squashed commit: [8058e6aba] 1 error left [b0157b252] 2 errors [7fa494907] 4 errors [03139391e] 6 failures, 4 errors [7f017ea23] 12 errors [3e9ad758d] 0 failures, 13 errors [e24a3cb3e] 3 failures, 13 errors [6edcaa655] 4 failures 14 errors [9623bda57] 6 failures, 13 errors [04c35c995] 4 failed 22 errors [5f5335c15] 9 failures [9a33540e2] down to 20 failures [0e7b73b49] remove old tests [5cc6d11b7] fixup the resources [8c508d45a] some more progress [4acef3c3b] some more work [85cdb5d06] some ports cleanup [1987ac2ec] lint before unit [6fa221789] enable unit tests [c212b695d] other name [b78594518] common test name fix [ef6597e79] indent [8cbcfb5e4] common test rename [1ca838c16] seperate common tests [ef052b022] create two seperate job for common testing [67eb0e9b3] use devcontainer for release shizzle [0c47c482b] make it a sudo [4d8900b16] force install jq [9660cdd47] try something else [e2b611917] bump common to run tests (to fix them) [277241bbf] only use the new devcontainer for the release tests for now... [9c7b68e0f] Revert "remove setup chart testing action" This reverts commit 6987914587a58ab5a52a05b836d60ef91f1619d5. [444914311] Revert "use integrated k3d" This reverts commit d9bcb2f35d154b0afe1eb851729c37789b6ba0ea. (+6 squashed commit) Squashed commit: [313446184] Revert "correct k3s version" This reverts commit 81fa8a43c41c2449b7411e0d59a3c2bbe0aef1ea. [41b4d4795] Revert "version name tryout" This reverts commit bbb8dcead9f9426872390b8f89b1fd0e661534bb. [b64df97a0] Revert "change version" This reverts commit 8080395dc80e606769ad9790b35d35fac4d1d3ed. [ed63220d4] Revert "use k3s kubectl" This reverts commit ea81735d939e838ad595835ea09b54bff817dd83. [6267a2908] Revert "use normal kubectl" This reverts commit 216d3799111d47f65dd20dd85ccb8fbc586a9c2b. [f48ddde73] Revert "try to set kubectl context" This reverts commit a5e8a532c5620e0d9d4cb7a53a371ba200265612. [a5e8a532c] try to set kubectl context [216d37991] use normal kubectl [ea81735d9] use k3s kubectl [8080395dc] change version [bbb8dcead] version name tryout [81fa8a43c] correct k3s version [d9bcb2f35] use integrated k3d [698791458] remove setup chart testing action [5bd7cf01d] bump common-test
2021-09-28 22:11:52 +00:00
if: ${{ matrix.app != 'common' && matrix.app != '.gitkee' }}
id: lint
run: ct lint --config .github/ct-lint.yaml --charts 'charts/${{ steps.prep-lint.outputs.train }}/${{ matrix.app }}'
- name: Create k3d cluster
if: ${{ matrix.app != 'common' && matrix.app != '.gitkee' && steps.prep-lint.outputs.install != 'false' }}
uses: nolar/setup-k3d-k3s@v1
with:
2021-12-05 10:55:41 +00:00
version: v1.22.4+k3s1
## TODO: Fix common-test
- name: Run chart-testing (install)
if: ${{ matrix.app != 'common' && matrix.app != '.gitkee' && steps.prep-lint.outputs.install != 'false' }}
2021-12-05 10:55:41 +00:00
run: find ./ -type f -name *.yaml -exec sed -i 's/tccr.io/ghcr.io/gI' {} \; && ct install --config .github/ct-install.yaml --charts '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"
release-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/truecharts/devcontainer:v2.2.1
steps:
2021-08-17 12:04:31 +00:00
- name: Cache helm repo cache
2021-08-17 12:10:04 +00:00
id: cache
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # renovate: tag=v2
2021-08-17 12:04:31 +00:00
with:
key: helmrepocache-${{ github.sha }}
path: |
~/.cache/helm/repository
~/.config/helm/repositories.yaml
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2
name: Checkout
with:
fetch-depth: 100
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2
with:
repository: truecharts/catalog
path: catalog
2021-08-17 10:23:52 +00:00
- name: build-and-run
run: |
tools/build-release.sh --config .github/cr.yaml