Files
tx-sync/.gitea/workflows/ci.yml
T
jamie 791c3c2393
CI / build (tx-sync-linux-amd64, amd64, linux) (push) Successful in 22s
CI / build (tx-sync-windows-amd64.exe, amd64, windows) (push) Successful in 15s
CI / SonarQube (push) Successful in 22s
ci: 🚀 sonarqube
2026-05-07 01:05:55 +01:00

71 lines
1.7 KiB
YAML

name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: build-htz-01
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
artifact: tx-sync-linux-amd64
- goos: windows
goarch: amd64
artifact: tx-sync-windows-amd64.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: go test ./...
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOAMD64: v1
CGO_ENABLED: "0"
run: go build -trimpath -ldflags="-s -w" -o "${{ matrix.artifact }}" .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
sonarqube:
name: SonarQube
runs-on: build-htz-01
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Valid Project Key
id: sonar_setup
run: |
CLEAN_KEY=$(echo "${{ gitea.repository }}" | tr '/' ':')
echo "key=$CLEAN_KEY" >> $GITHUB_OUTPUT
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
with:
args: >
-Dsonar.projectKey=${{ steps.sonar_setup.outputs.key }}
-Dsonar.projectName=${{ gitea.repository }}
-Dsonar.qualitygate.wait=true