helm.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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@v3
  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.0
  31. with:
  32. python-version: 3.7
  33. - name: Set up chart-testing
  34. uses: helm/chart-testing-action@v2.4.0
  35. - name: Run chart-testing (list-changed)
  36. id: list-changed
  37. run: |
  38. changed=$(ct list-changed --config=.github/ci/ct.yaml)
  39. if [[ -n "$changed" ]]; then
  40. echo "::set-output name=changed::true"
  41. fi
  42. - name: Install chart unittest
  43. run: |
  44. helm env
  45. helm plugin install https://github.com/helm-unittest/helm-unittest
  46. - name: Run chart-testing (lint)
  47. run: ct lint --config=.github/ci/ct.yaml
  48. - name: Create kind cluster
  49. uses: helm/kind-action@v1.8.0
  50. if: steps.list-changed.outputs.changed == 'true'
  51. - name: Run chart-testing (install)
  52. run: ct install --config=.github/ci/ct.yaml --charts deploy/charts/external-secrets
  53. if: steps.list-changed.outputs.changed == 'true'
  54. - name: Run unitests
  55. if: steps.list-changed.outputs.changed == 'true'
  56. run: make helm.test
  57. release:
  58. runs-on: ubuntu-latest
  59. steps:
  60. - name: Checkout
  61. uses: actions/checkout@v3
  62. with:
  63. fetch-depth: 0
  64. - name: Configure Git
  65. run: |
  66. git config user.name "$GITHUB_ACTOR"
  67. git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
  68. - name: Set up Helm
  69. uses: azure/setup-helm@v3.4
  70. with:
  71. version: v3.4.2
  72. - name: Generate chart
  73. run: |
  74. make helm.generate
  75. - name: Run chart-releaser
  76. uses: helm/chart-releaser-action@v1.5.0
  77. if: |
  78. github.ref == 'refs/heads/main' ||
  79. startsWith(github.ref, 'refs/heads/release-')
  80. env:
  81. CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  82. CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
  83. with:
  84. charts_dir: deploy/charts
  85. charts_repo_url: https://charts.external-secrets.io