-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from smlx/overhaul-ci
overhaul ci
- Loading branch information
Showing
21 changed files
with
372 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* Taken from: https://github.com/wagoid/commitlint-github-action/blob/7f0a61df502599e1f1f50880aaa7ec1e2c0592f2/commitlint.config.mjs */ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { maxLineLength } from '@commitlint/ensure' | ||
|
||
const bodyMaxLineLength = 100 | ||
|
||
const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => { | ||
const { type, scope, body } = parsedCommit | ||
const isDepsCommit = | ||
type === 'chore' && (scope === 'deps' || scope === 'deps-dev') | ||
|
||
return [ | ||
isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength), | ||
`body's lines must not be longer than ${bodyMaxLineLength}`, | ||
] | ||
} | ||
|
||
export default { | ||
extends: ['@commitlint/config-conventional'], | ||
plugins: ['commitlint-plugin-function-rules'], | ||
rules: { | ||
'body-max-line-length': [0], | ||
'function-rules/body-max-line-length': [ | ||
2, | ||
'always', | ||
validateBodyMaxLengthIgnoringDeps, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
commit-message: | ||
prefix: chore | ||
include: scope | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
- package-ecosystem: gomod | ||
commit-message: | ||
prefix: chore | ||
include: scope | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
groups: | ||
gomod: | ||
patterns: | ||
- "*" | ||
update-types: | ||
- "minor" | ||
- "patch" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md | ||
allow-licenses: | ||
- 'Apache-2.0' | ||
- 'BSD-2-Clause' | ||
- 'BSD-2-Clause-FreeBSD' | ||
- 'BSD-3-Clause' | ||
- 'ISC' | ||
- 'MIT' | ||
- 'PostgreSQL' | ||
- 'Python-2.0' | ||
- 'X11' | ||
- 'Zlib' | ||
|
||
allow-dependencies-licenses: | ||
# this action is GPL-3 but it is only used in CI | ||
# https://github.com/actions/dependency-review-action/issues/530#issuecomment-1638291806 | ||
- pkg:githubactions/vladopajic/go-test-coverage@bcd064e5ceef1ccec5441519eb054263b6a44787 | ||
# this package is MPL-2.0 and has a CNCF exception | ||
# https://github.com/cncf/foundation/blob/9b8c9173c2101c1b4aedad3caf2c0128715133f6/license-exceptions/cncf-exceptions-2022-04-12.json#L43C17-L43C47 | ||
- pkg:golang/github.com/go-sql-driver/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: build | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
permissions: {} | ||
jobs: | ||
build-snapshot: | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
binary: | ||
- go-cli-github | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version: stable | ||
- run: echo "GOVERSION=$(go version)" >> "$GITHUB_ENV" | ||
- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | ||
id: goreleaser | ||
with: | ||
version: latest | ||
args: build --clean --debug --single-target --snapshot |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
name: Coverage | ||
name: coverage | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: {} | ||
jobs: | ||
coverage: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Configure git | ||
run: | | ||
git config --global user.name "$GITHUB_ACTOR" | ||
git config --global user.email "[email protected]" | ||
- name: Set up go | ||
uses: actions/setup-go@v5 | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version: stable | ||
- name: Calculate coverage | ||
run: go test -v -covermode=count -coverprofile=coverage.out | ||
- name: Convert coverage to lcov | ||
uses: jandelgado/[email protected] | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@v2 | ||
run: | | ||
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./... | ||
# remove generated code from coverage calculation | ||
grep -Ev 'internal/mock|_enumer.go' cover.out.raw > cover.out | ||
- name: Generage coverage badge | ||
uses: vladopajic/go-test-coverage@1079cd4e58dda229c04ffdb6324fc3756b8542ff # v2.10.1 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
profile: cover.out | ||
local-prefix: github.com/${{ github.repository }} | ||
git-token: ${{ secrets.GITHUB_TOKEN }} | ||
# orphan branch for storing badges | ||
git-branch: badges |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: dependency review | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
permissions: {} | ||
jobs: | ||
dependency-review: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- uses: actions/dependency-review-action@0c155c5e8556a497adf53f2c18edabf945ed8e70 # v4.3.2 | ||
with: | ||
config-file: .github/dependency-review-config.yaml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: lint | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
permissions: {} | ||
jobs: | ||
lint-go: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version: stable | ||
- uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5.1.0 | ||
with: | ||
args: --timeout=180s --enable gocritic | ||
lint-commits: | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/commitlint-github-action@7f0a61df502599e1f1f50880aaa7ec1e2c0592f2 # v6.0.1 | ||
with: | ||
configFile: .github/commitlint.config.mjs | ||
lint-actions: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- uses: docker://rhysd/actionlint:1.7.0@sha256:601d6faeefa07683a4a79f756f430a1850b34d575d734b1d1324692202bf312e # v1.7.0 | ||
with: | ||
args: -color |
Oops, something went wrong.