Compare commits
25 Commits
releases/3
...
cc7b23f13d
Author | SHA1 | Date | |
---|---|---|---|
cc7b23f13d | |||
c38278ead6 | |||
5950be2052 | |||
f533449926 | |||
bf9f126be4 | |||
c1b1bc6553 | |||
32a18f3982 | |||
e9d32e1dc0 | |||
f5a5c2ed8d | |||
9376209c92 | |||
73ae8fdec2 | |||
d9c174ef40 | |||
ee2a53a447 | |||
ed48f94bfc | |||
6f396d96a1 | |||
597df8e6f6 | |||
1f558fe8f4 | |||
d27b9491f3 | |||
763b204760 | |||
295d7d5373 | |||
7d48072102 | |||
23fb18d792 | |||
323b6e651c | |||
c86b2a5729 | |||
88f69b1935 |
@@ -2,13 +2,16 @@ name: Build and push OCI image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "test-workflow"
|
||||
tags:
|
||||
- "**"
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
VERSION: ${{ github.ref_name }}
|
||||
REGISTRY: repo.katenary.io
|
||||
IMAGE_NAME: ${{ gitea.repository }}
|
||||
VERSION: ${{ gitea.ref_name }}
|
||||
STORAGE_DRIVER: vfs
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -17,27 +20,38 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: debug
|
||||
run: |
|
||||
echo GT ${{ secrets.GITHUB_TOKEN }} | base64
|
||||
echo GH ${{ secrets.GITEA_TOKEN }} | base64
|
||||
test -z "${{ secrets.GITEA_TOKEN}}" && echo "GITEA_TOKEN is empty"
|
||||
test -z "${{ secrets.GITHUB_TOKEN}}" && echo "GITHUB_TOKEN is empty"
|
||||
echo actor ${{ gitea.actor }}
|
||||
|
||||
- name: Install Buildah
|
||||
run: |-
|
||||
if ! comamnd -v buildah 2>/dev/null; then
|
||||
env
|
||||
if ! command -v buildah 2>/dev/null; then
|
||||
echo "Install Buildah"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y buildah
|
||||
else
|
||||
echo "Buildah already installed"
|
||||
fi
|
||||
- name: Login to repository
|
||||
run: |
|
||||
buildah login $REGISTRY -u ${{ gitea.actor }} -p ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build and tag
|
||||
run: |-
|
||||
buildah build --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
|
||||
buildah build --isolation=chroot --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
|
||||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
||||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:latest
|
||||
|
||||
- name: Push image
|
||||
run: |-
|
||||
buildah login $REGISTRY -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||
buildah push $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
||||
buildah push $REGISTRY/${IMAGE_NAME,,}:latest
|
69
.gitea/workflows/go-test.yaml
Normal file
69
.gitea/workflows/go-test.yaml
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Go-Tests
|
||||
|
||||
on:
|
||||
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.organization=metal3d
|
||||
sonar.projectKey=katenary_katenary
|
||||
sonar.organization=katenary
|
||||
|
||||
|
||||
sonar.go.tests.reportPaths=gotest.json
|
||||
|
Reference in New Issue
Block a user