helm.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Helm
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - release-*
  7. paths:
  8. - 'deploy/charts/**'
  9. - 'deploy/crds'
  10. pull_request:
  11. paths:
  12. - 'deploy/charts/**'
  13. - 'deploy/crds'
  14. workflow_dispatch: {}
  15. jobs:
  16. lint-and-test:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout
  20. uses: actions/checkout@v4
  21. with:
  22. fetch-depth: 0
  23. - name: Generate chart
  24. run: |
  25. make helm.generate
  26. - name: Set up Helm
  27. uses: azure/setup-helm@v3.5
  28. with:
  29. version: v3.4.2
  30. - uses: actions/setup-python@v4.7.1
  31. with:
  32. python-version: 3.7
  33. - name: Set up chart-testing
  34. # before upgrading, please see if this has been fixed:
  35. # https://github.com/helm/chart-testing-action/issues/132
  36. uses: helm/chart-testing-action@v2.3.1
  37. - name: Run chart-testing (list-changed)
  38. id: list-changed
  39. run: |
  40. changed=$(ct list-changed --config=.github/ci/ct.yaml)
  41. if [[ -n "$changed" ]]; then
  42. echo "::set-output name=changed::true"
  43. fi
  44. - name: Install chart unittest
  45. run: |
  46. helm env
  47. helm plugin install https://github.com/helm-unittest/helm-unittest
  48. - name: Run chart-testing (lint)
  49. run: ct lint --config=.github/ci/ct.yaml
  50. - name: Create kind cluster
  51. uses: helm/kind-action@v1.8.0
  52. if: steps.list-changed.outputs.changed == 'true'
  53. - name: Run chart-testing (install)
  54. run: ct install --config=.github/ci/ct.yaml --charts deploy/charts/external-secrets
  55. if: steps.list-changed.outputs.changed == 'true'
  56. - name: Run unitests
  57. if: steps.list-changed.outputs.changed == 'true'
  58. run: make helm.test
  59. release:
  60. runs-on: ubuntu-latest
  61. steps:
  62. - name: Checkout
  63. uses: actions/checkout@v4
  64. with:
  65. fetch-depth: 0
  66. - name: Configure Git
  67. run: |
  68. git config user.name "$GITHUB_ACTOR"
  69. git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
  70. - name: Set up Helm
  71. uses: azure/setup-helm@v3.4
  72. with:
  73. version: v3.4.2
  74. - name: Generate chart
  75. run: |
  76. make helm.generate
  77. - name: Run chart-releaser
  78. uses: helm/chart-releaser-action@v1.6.0
  79. if: |
  80. github.ref == 'refs/heads/main' ||
  81. startsWith(github.ref, 'refs/heads/release-')
  82. env:
  83. CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  84. CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
  85. with:
  86. charts_dir: deploy/charts
  87. charts_repo_url: https://charts.external-secrets.io