Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for stable release #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: "2"
plugins:
gofmt:
enabled: true
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Module Build

env:
GO_VERSION: '1.21'

on:
push:
branches:
- master
paths-ignore:
- README.md
pull_request:
branches:
- master
paths-ignore:
- README.md

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version: [ '1.19', '1.20', '1.21' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Test
run: go test -v -race ./... > test-results-${{ matrix.go-version }}.log

- name: Upload Go test results
uses: actions/upload-artifact@v3
with:
name: Test Results ${{ matrix.go-version }}
path: test-results-${{ matrix.go-version }}.log

build:
runs-on: ubuntu-20.04
needs: [ test ]

strategy:
matrix:
go-version: [ '1.19', '1.20', '1.21' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: go build -v ./...

qa:
runs-on: ubuntu-20.04
needs: [ test, build ]
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup Code Climate
uses: remarkablemark/setup-codeclimate@v1

- name: Coverage
run: |
cc-test-reporter before-build
go test -v -coverprofile c.out -coverpkg ./... -race
cc-test-reporter after-build --coverage-input-type gocov --prefix $(go list) --exit-code $?
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go

- name: Build
run: go build -v ./...

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:go"

40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Module Release

env:
GO_VERSION: '1.21'

on:
push:
tags:
- v*.*.*

jobs:
goreleaser:
runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --clean

- name: Run vangen
run: |
go install 4d63.com/vangen@latest
./scripts/vangen.sh
env:
VANGEN_TOKEN: ${{ secrets.VANGEN_TOKEN }}
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ _testmain.go
*.prof

# go-syno diretories
vendor
coverage.out

c.out
test-results-*
html
vangen.json
examples/cache
30 changes: 30 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
builds:
- skip: true

changelog:
sort: asc
use: github
filters:
exclude:
- "^test:"
- "^chore"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: "New Features"
regexp: "^.*feat[(\\w)]*:+.*$"
order: 100
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 200
- title: Dependency updates
regexp: "^.*deps[(\\w)]*:+.*$"
order: 300
- title: "Documentation updates"
regexp: "^.*docs[(\\w)]*:+.*$"
order: 400
- title: Other work
order: 9999
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

Loading