95 lines
1.9 KiB
YAML
95 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "pics"
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "VERSION"
|
|
- ".bumpversion.cfg"
|
|
- "**.md"
|
|
- "catalog-info.yaml"
|
|
- "mkdocs.yml"
|
|
- "philips-repo.yaml"
|
|
|
|
pull_request:
|
|
branches: [pics]
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "VERSION"
|
|
- ".bumpversion.cfg"
|
|
- "**.md"
|
|
- "catalog-info.yaml"
|
|
- "mkdocs.yml"
|
|
- "philips-repo.yaml"
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
Lint:
|
|
name: Lint - golangci-lint
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.22.4
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.61.0
|
|
|
|
Tests:
|
|
name: Tests - Executing unit tests
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract branch name
|
|
uses: vazco/github-actions-branch-name@v1
|
|
id: branch
|
|
|
|
- name: Set up Go 1.22.4
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.22.4
|
|
id: go
|
|
|
|
- name: Downloads golang mods
|
|
run: |
|
|
go mod download
|
|
|
|
- name: Verify Code Generation
|
|
run: |
|
|
make verify-generate
|
|
|
|
- name: Build
|
|
run: |
|
|
make build
|
|
|
|
- name: Test
|
|
run: |
|
|
make test
|
|
|
|
Build:
|
|
needs: [Tests, Lint]
|
|
name: Build - Building and publishig Docker images
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
oauth2proxyPRTag: ${{ steps.setVariables.outputs.prTag }}
|
|
oauth2proxyCITag: ${{ steps.setVariables.outputs.betaTag }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: ${{ github.workspace }}
|
|
push: false
|
|
tags: docker.eu1.hsdp.io/reporting:${{ github.run_id }}
|