Skip to content

Commit

Permalink
GitHub Action: Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrufus committed Nov 14, 2024
1 parent bc26115 commit 0b27b4d
Show file tree
Hide file tree
Showing 8 changed files with 992 additions and 84 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Go

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read # TODO!

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
args: --verbose

diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go mod tidy -diff
- run: go mod download
- run: go mod verify
- run: go generate ./...
- name: Detect uncommitted changes
run: |
changes=$(git status --porcelain)
if [[ -n "$changes" ]]; then
{
echo "## :construction: Uncommitted changes"
echo "\`\`\`console"
echo "\$ git status --porcelain"
echo "$changes"
echo "\`\`\`"
} >> "$GITHUB_STEP_SUMMARY"
echo "::group::Uncommitted changes"
echo "$changes"
echo "::endgroup::"

exit 1
fi

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go mod download
- run: go mod verify
- run: go test -v -count=1 -race -shuffle=on ./...
14 changes: 7 additions & 7 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: govulncheck

on:
schedule:
- cron: '13 05 * * *' # Daily at 05:13 UTC
- cron: '1 1 * * 1'
workflow_dispatch:
pull_request:
branches:
Expand All @@ -11,14 +11,14 @@ on:
branches:
- main

permissions:
contents: read # TODO!!!

jobs:
govulncheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: golang/govulncheck-action@v1
with:
go-version: 'stable'
- run: go version
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
- run: govulncheck --show version -test ./...
go-version-file: 'go.mod'
go-package: ./...
40 changes: 0 additions & 40 deletions .github/workflows/lint.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ linters:
disable:
- dupl
- depguard
- err113
- testpackage
- varnamelen
- wrapcheck
- wsl
- nlreturn
- revive
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/typisttech/comver

go 1.22.1
go 1.23
17 changes: 15 additions & 2 deletions test/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import (
)

var invalidWordFenceVersions = []string{ //nolint:gochecknoglobals
"*",
".3.1",
".47.1",
".48.9",
".51",
".51.1",
".51",
".52.5",
".53.2",
".53.4",
"*",
"08-03-2018",
"1.0 12319",
"1.0f",
Expand All @@ -35,12 +36,18 @@ var invalidWordFenceVersions = []string{ //nolint:gochecknoglobals
"17-07-2019",
"2.0.1.8.2",
"2.0.5.4.1",
"2.0e",
"2.35.1.2.3",
"2.35.1.3.0",
"2.5d",
"2.9.9.2.8",
"2.9.9.2.9",
"2.9.9.3.4",
"2.9.9.4.0",
"2.9.9.4.7",
"2.9.9.5.0",
"2.9.9.5.0",
"2.9.9.5.1",
"3.0 (Beta r7)",
"3.1.0.1.1",
"3.1.1.4.2",
Expand All @@ -51,9 +58,15 @@ var invalidWordFenceVersions = []string{ //nolint:gochecknoglobals
"3.9.9.0.1",
"4.1.7.3.2",
"4.10.44.decaf",
"4.10.46.decaf",
"4.2.6.8.1",
"4.2.6.8.2",
"4.2.6.9.3",
"4.23.1.1.23.1",
"5 alpha 2",
"5.8 beta 1",
"5.8 beta 2",
"6.2-revision-5",
"8..1",
"p1.2.5",
}
Expand Down
Loading

0 comments on commit 0b27b4d

Please sign in to comment.