test-chart.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # This is a GitHub workflow defining a set of jobs with a set of steps.
  2. # ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
  3. #
  4. name: Test chart
  5. on:
  6. pull_request:
  7. paths-ignore:
  8. - "README.md"
  9. push:
  10. branches-ignore:
  11. - "dependabot/**"
  12. workflow_dispatch:
  13. permissions:
  14. contents: read
  15. jobs:
  16. lint-templates:
  17. runs-on: ubuntu-22.04
  18. steps:
  19. - uses: actions/checkout@v3
  20. - uses: actions/setup-python@v4
  21. with:
  22. python-version: "3.x"
  23. - name: Install dependencies (yamllint)
  24. run: pip install yamllint
  25. - run: helm dependency update
  26. - name: helm lint
  27. run: |
  28. helm lint . \
  29. --values dev-values.yaml
  30. - name: helm template
  31. run: |
  32. helm template . \
  33. --values dev-values.yaml \
  34. --output-dir rendered-templates
  35. - name: yamllint (only on templates we manage)
  36. run: |
  37. rm -rf rendered-templates/mastodon/charts
  38. yamllint rendered-templates \
  39. --config-data "{rules: {indentation: {spaces: 2}, line-length: disable}}"
  40. # This job helps us validate that rendered templates are valid k8s resources
  41. # against a k8s api-server, via "helm template --validate", but also that a
  42. # basic configuration can be used to successfully startup mastodon.
  43. #
  44. test-install:
  45. runs-on: ubuntu-22.04
  46. timeout-minutes: 15
  47. strategy:
  48. fail-fast: false
  49. matrix:
  50. include:
  51. # k3s-channel reference: https://update.k3s.io/v1-release/channels
  52. - k3s-channel: latest
  53. - k3s-channel: stable
  54. # This represents the oldest configuration we test against.
  55. #
  56. # The k8s version chosen is based on the oldest still supported k8s
  57. # version among two managed k8s services, GKE, EKS.
  58. # - GKE: https://endoflife.date/google-kubernetes-engine
  59. # - EKS: https://endoflife.date/amazon-eks
  60. #
  61. # The helm client's version can influence what helper functions is
  62. # available for use in the templates, currently we need v3.6.0 or
  63. # higher.
  64. #
  65. - k3s-channel: v1.21
  66. helm-version: v3.8.0
  67. env:
  68. HELM_EXPERIMENTAL_OCI: "1"
  69. steps:
  70. - uses: actions/checkout@v3
  71. # This action starts a k8s cluster with NetworkPolicy enforcement and
  72. # installs both kubectl and helm.
  73. #
  74. # ref: https://github.com/jupyterhub/action-k3s-helm#readme
  75. #
  76. - uses: jupyterhub/action-k3s-helm@v3
  77. with:
  78. k3s-channel: ${{ matrix.k3s-channel }}
  79. helm-version: ${{ matrix.helm-version }}
  80. metrics-enabled: false
  81. traefik-enabled: false
  82. docker-enabled: false
  83. - run: helm dependency update
  84. # Validate rendered helm templates against the k8s api-server
  85. - name: helm template --validate
  86. run: |
  87. helm template --validate mastodon . \
  88. --values dev-values.yaml
  89. - name: helm install
  90. run: |
  91. helm install mastodon . \
  92. --values dev-values.yaml \
  93. --timeout 10m
  94. # This actions provides a report about the state of the k8s cluster,
  95. # providing logs etc on anything that has failed and workloads marked as
  96. # important.
  97. #
  98. # ref: https://github.com/jupyterhub/action-k8s-namespace-report#readme
  99. #
  100. - name: Kubernetes namespace report
  101. uses: jupyterhub/action-k8s-namespace-report@v1
  102. if: always()
  103. with:
  104. important-workloads: >-
  105. deploy/mastodon-sidekiq
  106. deploy/mastodon-streaming
  107. deploy/mastodon-web
  108. job/mastodon-assets-precompile
  109. job/mastodon-chewy-upgrade
  110. job/mastodon-create-admin
  111. job/mastodon-db-migrate