charts_tests.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. name: Charts Tests
  2. on:
  3. pull_request:
  4. paths:
  5. - library/**
  6. - '!library/common'
  7. - '!library/common-test'
  8. - .github/ct-install-config/**
  9. - '!.github/ct-install-config/common*'
  10. - .github/workflows/charts_test.yaml
  11. jobs:
  12. lint:
  13. name: Lint Charts
  14. runs-on: ubuntu-22.04
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. helm-version:
  19. - v3.9.4
  20. - v3.10.3
  21. - v3.11.1
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
  25. with:
  26. # Depth 0 is required for chart-testing to work properly
  27. fetch-depth: 0
  28. - name: Install Helm
  29. uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # tag=v3
  30. with:
  31. version: ${{ matrix.helm-version }}
  32. - uses: actions/setup-python@2c3dd9e7e29afd70cc0950079bde6c979d1f69f9 # tag=v4
  33. with:
  34. python-version: "3.10"
  35. - name: Set up chart-testing
  36. uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec # tag=v2.3.1
  37. - name: Run chart-testing (lint)
  38. id: lint
  39. run: |
  40. ct lint --config .github/ct-install-config/charts-ct-lint.yaml
  41. install:
  42. needs:
  43. - lint
  44. name: Install Charts
  45. runs-on: ubuntu-22.04
  46. strategy:
  47. fail-fast: false
  48. matrix:
  49. # We run tests on k3s version of latest SCALE release, SCALE nightly and manually defined "latest"
  50. k3s-version:
  51. - v1.25.3+k3s1
  52. # We run tests on Helm version of latest SCALE release, SCALE nightly and manually defined "latest"
  53. helm-version:
  54. - v3.9.4
  55. - v3.11.1
  56. steps:
  57. - name: Checkout
  58. uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
  59. with:
  60. # Depth 0 is required for chart-testing to work properly
  61. fetch-depth: 0
  62. - name: Install Helm
  63. uses: azure/setup-helm@f382f75448129b3be48f8121b9857be18d815a82 # tag=v3
  64. with:
  65. version: ${{ matrix.helm-version }}
  66. - uses: actions/setup-python@2c3dd9e7e29afd70cc0950079bde6c979d1f69f9 # tag=v4
  67. with:
  68. python-version: "3.10"
  69. - name: Set up chart-testing
  70. uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec # tag=v2.3.1
  71. - name: Create k3d cluster - Attempt 1/3
  72. continue-on-error: true
  73. id: createc1
  74. uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96 # tag=v1.0.9
  75. with:
  76. github-token: ${{ secrets.GITHUB_TOKEN }}
  77. version: ${{ matrix.k3s-version }}
  78. # Flags found here https://github.com/k3d-io/k3d
  79. k3d-args: --k3s-arg --disable=metrics-server@server:*
  80. - name: Wait 10 second to retry
  81. if: steps.createc1.outcome=='failure'
  82. run: |
  83. sleep 10
  84. - name: Create k3d cluster - Attempt 2/3
  85. continue-on-error: true
  86. if: steps.createc1.outcome=='failure'
  87. id: createc2
  88. uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96 # tag=v1.0.9
  89. with:
  90. github-token: ${{ secrets.GITHUB_TOKEN }}
  91. version: ${{ matrix.k3s-version }}
  92. # Flags found here https://github.com/k3d-io/k3d
  93. k3d-args: --k3s-arg --disable=metrics-server@server:*
  94. - name: Wait 10 second to retry
  95. if: steps.createc2.outcome=='failure'
  96. run: |
  97. sleep 10
  98. - name: Create k3d cluster - Attempt 3/3
  99. id: createc3
  100. if: steps.createc2.outcome=='failure'
  101. uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96 # tag=v1.0.9
  102. with:
  103. github-token: ${{ secrets.GITHUB_TOKEN }}
  104. version: ${{ matrix.k3s-version }}
  105. # Flags found here https://github.com/k3d-io/k3d
  106. k3d-args: --k3s-arg --disable=metrics-server@server:*
  107. - name: Run chart-testing (install)
  108. run: |
  109. ct install --config .github/ct-install-config/charts-ct-install.yaml