Skip to content

Commit

Permalink
fix: yearly maintanence
Browse files Browse the repository at this point in the history
Signed-off-by: Eray Ates <[email protected]>
  • Loading branch information
rytsh committed Sep 7, 2024
1 parent b8e86c7 commit a7308c0
Show file tree
Hide file tree
Showing 20 changed files with 353 additions and 533 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/golangci-lint.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
# stable: 'false' # Keep this line to be able to use rc and beta version of Go (ex: 1.18.0-rc1).
go-version: 1.18
go-version: 1.23
- name: Unshallow
run: git fetch --prune --unshallow

Expand All @@ -34,6 +32,7 @@ jobs:
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
57 changes: 42 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
name: Test

on: [push, pull_request]
on:
push:
branches:
- '**'

name: Test
jobs:
test:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ secrets.GO_VERSION }}

- name: Run coverage
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
- name: get epository name
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.23' # The Go version to download (if necessary) and use.
- name: download golangci.yml
run: |
[[ ! -f ".golangci.yml" ]] && curl -kfsSL -O https://raw.githubusercontent.com/worldline-go/guide/main/lint/.golangci.yml || true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout 5m --new-from-rev=HEAD~1 --issues-exit-code=0
- name: Run tests
run: |
GOPATH="$(dirname ${PWD})" golangci-lint run --out-format checkstyle ./... > golangci-lint-report.out || true
go test -coverprofile=coverage.out -json ./... > test-report.out
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectKey=${{ github.repository_owner }}_${{ env.REPOSITORY_NAME }}
-Dsonar.go.coverage.reportPaths=coverage.out
-Dsonar.go.tests.reportPaths=test-report.out
-Dsonar.go.golangci-lint.reportPaths=golangci-lint-report.out
-Dsonar.sources=.
-Dsonar.exclusions=**/vendor/**,**/*_test.go
-Dsonar.tests=.
-Dsonar.test.inclusions=**/*_test.go
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25 changes: 18 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
version: 2
project_name: forward

release:
Expand All @@ -23,13 +24,13 @@ builds:
flags:
- -trimpath
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
- name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip
Expand Down Expand Up @@ -96,3 +97,13 @@ dockers:
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"

brews:
- name: forward
homepage: https://github.com/worldline-go/forward
description: "export socket connections"
repository:
owner: brew-tools
name: homebrew-tap
token: "{{ .Env.BREW_TOKEN }}"
directory: Formula
Loading

0 comments on commit a7308c0

Please sign in to comment.