Skip to content

Servicemonitor (#9) #72

Servicemonitor (#9)

Servicemonitor (#9) #72

Workflow file for this run

---
name: Lint, Test, Image Build and Chart release
on:
push:
branches: [ main ]
tags: [ '**' ]
pull_request:
branches: [ main ]
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 5m
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
- run: go test -v ./... -covermode=atomic -coverprofile=coverage.out
- uses: codecov/codecov-action@v3
with:
files: coverage.out
build-main:
name: build
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
file: "Dockerfile"
context: .
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
build-clients:
name: build
runs-on: ubuntu-latest
needs:
- lint
- test
strategy:
matrix:
dir: ["clients/proxy-client", "clients/harbor-client"]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
file: "${{ matrix.dir }}/Dockerfile"
context: ${{ matrix.dir }}
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}/${{ matrix.dir }}:${{ github.sha }}
release:
name: release
runs-on: ubuntu-latest
needs:
- build-main
- build-clients
strategy:
matrix:
dir: ["deploymant", "clients/proxy-client", "clients/harbor-client"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: ${{ matrix.dir }}
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"