Skip to content

added more linting and testing - updated helm charts push endpoint #12

added more linting and testing - updated helm charts push endpoint

added more linting and testing - updated helm charts push endpoint #12

Workflow file for this run

name: Validate on Pull Request
on:
workflow_dispatch:
pull_request:
types: [ opened, reopened, synchronize ]
jobs:
lint-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v3
- uses: actions/setup-python@v4
- name: Install chart-testing
uses: helm/[email protected]
- name: Run chart lint
run: ct lint --all --validate-maintainers=false --config .github/ct.yaml
lint-chart-docs:
runs-on: ubuntu-latest
needs: lint-chart
steps:
- name: Checkout
uses: actions/[email protected]
- name: Run helm-docs
run: .github/helm-docs.sh
kubeconform-chart:
runs-on: ubuntu-latest
needs:
- lint-chart-docs
strategy:
matrix:
k8s:
# from https://github.com/yannh/kubernetes-json-schema
- v1.26.9
- v1.27.8
- v1.28.4
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Run kubeconform
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
run: .github/kubeconform.sh
lint:
name: Lint files
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21.1'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-cache: true
args: --timeout=30m
test:
name: Run tests
runs-on: 'ubuntu-22.04'
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21.1'
- run: go test -v -cover ./...
security-checks:
runs-on: ubuntu-22.04
needs: test
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Get Branch Name
shell: bash
run: |
echo "branch_name=${{ github.event.pull_request.head.ref }}" >> "$GITHUB_ENV"
- name: Build Local Baski Image
uses: drewbernetes/[email protected]
id: build-and-scan-baski
with:
image-repo: "registry.hudson-viles.uk/public"
repo-username: ${{ secrets.REGISTRY_PUBLIC_USER }}
repo-password: ${{ secrets.REGISTRY_PUBLIC_PASSWORD }}
image-name: baski
image-tag: ${{ env.branch_name }}
check-severity: CRITICAL
trivyignore-from-s3: true
s3-endpoint: "https://api.s3.hudson-viles.uk/"
s3-access-key: ${{secrets.S3_ACCESS_KEY}}
s3-secret-key: ${{secrets.S3_SECRET_KEY}}
s3-bucket: "trivyignores"
s3-path: "baski"
add-latest-tag: false
publish-image: false
cosign-private-key: ${{secrets.COSIGN_KEY}}
cosign-password: ${{secrets.COSIGN_PASSWORD}}
cosign-tlog: false
dockerfile-path: docker/baski
- name: Build Local Baski Server Image
uses: drewbernetes/[email protected]
id: build-and-scan-server
with:
image-repo: "registry.hudson-viles.uk/public"
repo-username: ${{ secrets.REGISTRY_PUBLIC_USER }}
repo-password: ${{ secrets.REGISTRY_PUBLIC_PASSWORD }}
image-name: baski-server
image-tag: ${{ env.branch_name }}
check-severity: CRITICAL
trivyignore-from-s3: true
s3-endpoint: "https://api.s3.hudson-viles.uk/"
s3-access-key: ${{secrets.S3_ACCESS_KEY}}
s3-secret-key: ${{secrets.S3_SECRET_KEY}}
s3-bucket: "trivyignores"
s3-path: "baski-server"
add-latest-tag: false
publish-image: false
cosign-private-key: ${{secrets.COSIGN_KEY}}
cosign-password: ${{secrets.COSIGN_PASSWORD}}
cosign-tlog: false
dockerfile-path: docker/server