Skip to content

Initial ports service #10

Initial ports service

Initial ports service #10

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
# lint the dockerfile too
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
# lint and validate the helm chart
- name: Install Helm & Kubeconform
# this should all be cached ideally.
run: |
# i would build a generic docker image with tools like this in, and probably even a shared action in a
# .github private repo that i could use in all my projects
curl -LO https://get.helm.sh/helm-v3.12.0-linux-amd64.tar.gz
tar -xzf helm-v3.12.0-linux-amd64.tar.gz
curl -LO https://github.com/yannh/kubeconform/releases/v0.6.7/download/kubeconform-linux-amd64.tar.gz
tar -xzf kubeconform-linux-amd64.tar.gz
sudo mv kubeconform /usr/local/bin/
- name: Validate Helm Charts with Kubeconform
run: |
helm template helm/port-service | kubeconform -exit-on-error -strict -summary -schema-location https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{.ResourceKind}}/{{.ResourceAPIVersion}} -skip CustomResourceDefinition,MutatingWebhookConfiguration,ValidatingWebhookConfiguration
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Run tests
run: |
go test -v ./...
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build the project
run: |
go build -v ./...