Compare commits
13 Commits
master
...
ee2a53a447
Author | SHA1 | Date | |
---|---|---|---|
ee2a53a447 | |||
ed48f94bfc | |||
6f396d96a1 | |||
597df8e6f6 | |||
1f558fe8f4 | |||
d27b9491f3 | |||
763b204760 | |||
295d7d5373 | |||
7d48072102 | |||
23fb18d792 | |||
323b6e651c | |||
c86b2a5729 | |||
88f69b1935 |
@@ -1,14 +1,16 @@
|
|||||||
name: Build and push OCI image
|
name: Build and push OCI image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: repo.katenary.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ gitea.repository }}
|
||||||
VERSION: ${{ github.ref_name }}
|
VERSION: ${{ gitea.ref_name }}
|
||||||
|
STORAGE_DRIVER: vfs
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
70
.gitea/workflows/go-test.yaml
Normal file
70
.gitea/workflows/go-test.yaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
name: Go-Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- edited
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
- "main"
|
||||||
|
env:
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.25
|
||||||
|
- name: Install helm
|
||||||
|
run: |
|
||||||
|
command -v helm || curl -sSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
|
|
||||||
|
- name: Tidy
|
||||||
|
run: |
|
||||||
|
export GOPROXY='https://proxy.golang.org,direct'
|
||||||
|
go mod tidy
|
||||||
|
- name: Launch Test
|
||||||
|
run: |
|
||||||
|
go vet ./...
|
||||||
|
go test -coverprofile=coverprofile.out -json -v ./... > gotest.json
|
||||||
|
# - uses: actions/upload-artifact@v4
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: tests-results
|
||||||
|
path: |
|
||||||
|
coverprofile.out
|
||||||
|
gotest.json
|
||||||
|
sonar:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: tests
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
#- uses: actions/download-artifact@v4
|
||||||
|
- name: Download artifact
|
||||||
|
uses: christopherhx/gitea-download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: tests-results
|
||||||
|
- name: Sonar
|
||||||
|
run: |
|
||||||
|
export SONAR_SCANNER_VERSION=7.2.0.5079
|
||||||
|
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
|
||||||
|
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
|
||||||
|
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
||||||
|
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
|
||||||
|
sonar-scanner \
|
||||||
|
-Dsonar.organization=katenary \
|
||||||
|
-Dsonar.projectKey=katenary_katenary
|
50
.github/workflows/go-test.yaml
vendored
50
.github/workflows/go-test.yaml
vendored
@@ -1,50 +0,0 @@
|
|||||||
name: Go-Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- main
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- main
|
|
||||||
- "releases/**"
|
|
||||||
jobs:
|
|
||||||
tests:
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: 1.24
|
|
||||||
- name: Launch Test
|
|
||||||
run: |
|
|
||||||
go mod tidy
|
|
||||||
go vet ./... && go test -coverprofile=coverprofile.out -json -v ./... > gotest.json
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: tests-results
|
|
||||||
path: |
|
|
||||||
coverprofile.out
|
|
||||||
gotest.json
|
|
||||||
sonar:
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: read
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: tests
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: tests-results
|
|
||||||
- name: SonarQube Scan
|
|
||||||
uses: SonarSource/sonarqube-scan-action@v5.2.0
|
|
||||||
env:
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
|
|
@@ -1,5 +1,5 @@
|
|||||||
sonar.projectKey=metal3d_katenary
|
sonar.projectKey=katenary_katenary
|
||||||
sonar.organization=metal3d
|
sonar.organization=katenary
|
||||||
|
|
||||||
|
|
||||||
sonar.go.tests.reportPaths=gotest.json
|
sonar.go.tests.reportPaths=gotest.json
|
||||||
|
Reference in New Issue
Block a user