Skip to content

test: Move the testing proxy variables for the color mod to a separat… #367

test: Move the testing proxy variables for the color mod to a separat…

test: Move the testing proxy variables for the color mod to a separat… #367

Workflow file for this run

name: CI
on:
push:
branches: ["*"]
tags: ["v*"]
pull_request:
branches: ["*"]
permissions:
contents: write
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
test:
name: "Test"
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Create a test results directory
run: mkdir test-results
- name: Run tests
run: |
go test "./..." -coverprofile="test-results/coverage.out" -covermode=count
go test "./..." -coverprofile="coverage.out" -covermode=count -json > test-report.out
grep -v "test_utils.go" coverage.out > coverage.tmp
grep -v "test_utils.go" test-report.out > test-report.tmp
mv coverage.tmp test-results/coverage.out
mv test-report.tmp test-results/test-report.out
- uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results/
sonar-scan:
name: "SonarQube Scan"
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
deploy:
name: "Release"
needs: [build, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install "syft"
run: |
/bin/bash -c "curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin"
- name: "Run GoReleaser"
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if:
startsWith(github.ref, 'refs/tags/')