helm.yml 2.4 KB

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