Fix ruff check errors and format #133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Charts | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: chart-test-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
validate-charts: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: pip3 install pyyaml | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.6.1 | |
- name: Add Helm Repos | |
run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
- name: Lint Charts | |
run: ct lint --all --check-version-increment=false --validate-maintainers=false | |
- name: Validate Charts | |
run: python3 bin/validate.py | |
env: | |
CHARTS_DIR: charts | |
test-charts: | |
name: test-charts | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
needs: validate-charts | |
strategy: | |
matrix: | |
k8s: | |
- v1.25.8 | |
- v1.26.3 | |
- v1.27.1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.6.1 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::979633842206:role/HelmChartsDeployment | |
role-session-name: helm-charts-deploy | |
aws-region: eu-west-1 | |
- name: Add Helm Repos | |
run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
- name: Create kind ${{ matrix.k8s }} cluster | |
uses: helm/kind-action@v1.5.0 | |
with: | |
node_image: kindest/node:${{ matrix.k8s }} | |
- name: Authenticate with ECR | |
run: | | |
kubectl create secret docker-registry regcred \ | |
--docker-server=979633842206.dkr.ecr.eu-west-1.amazonaws.com \ | |
--docker-username=AWS \ | |
--docker-password=$(aws ecr get-login-password) \ | |
--namespace=default | |
- name: Add additional chart values | |
run: | | |
# Because the --helm-extra-set-args flag is apparently broken in CI | |
# this method is used instead | |
mkdir charts/mokta/ci | |
tee charts/mokta/ci/*-values.yaml<<EOF>>/dev/null | |
image: | |
imagePullSecretsRegcred: true | |
EOF | |
- name: Run chart-testing (install) ${{ matrix.k8s }} | |
run: | | |
ct install --all --namespace=default | |
publish-charts: | |
runs-on: ubuntu-22.04 | |
needs: test-charts | |
if: github.ref_name == 'main' | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
- name: Add Helm Repos | |
run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
- name: Configure Git | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Publish Charts | |
uses: helm/chart-releaser-action@v1.5.0 | |
with: | |
version: v1.5.0 | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |