Skip to content

Commit 5172f31

Browse files
committed
chore: ci
1 parent e129e78 commit 5172f31

File tree

5 files changed

+94
-14
lines changed

5 files changed

+94
-14
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ updates:
88
- package-ecosystem: "gomod" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "daily"
11+
interval: monthly
1212

1313
# Maintain dependencies for GitHub Actions
1414
- package-ecosystem: "github-actions"
1515
directory: "/"
1616
schedule:
17-
interval: "daily"
17+
interval: monthly

.github/workflows/go-cross.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Go Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
jobs:
14+
15+
cross:
16+
name: Go
17+
runs-on: ${{ matrix.os }}
18+
env:
19+
CGO_ENABLED: 0
20+
21+
strategy:
22+
matrix:
23+
go-version: [ stable, oldstable ]
24+
os: [ubuntu-latest, macos-latest, windows-latest]
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-go@v5
29+
with:
30+
go-version: ${{ matrix.go-version }}
31+
32+
- name: Test
33+
run: go test -v -cover ./...
34+
35+
- name: Build
36+
run: go build -ldflags "-s -w" -trimpath ./cmd/asciicheck/

.github/workflows/main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
jobs:
14+
15+
main:
16+
name: Main Process
17+
runs-on: ubuntu-latest
18+
env:
19+
GO_VERSION: stable
20+
GOLANGCI_LINT_VERSION: v2.4.0
21+
CGO_ENABLED: 0
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-go@v5
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
29+
- name: Check and get dependencies
30+
run: |
31+
go mod tidy
32+
git diff --exit-code go.mod
33+
git diff --exit-code go.sum
34+
35+
# https://golangci-lint.run/usage/install#other-ci
36+
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
37+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
38+
39+
- name: Make
40+
run: make

.gitignore

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,4 @@ gen
1818
# Output of the go coverage tool, specifically when used with LiteIDE
1919
*.out
2020

21-
# Dependency directories (remove the comment below to include it)
22-
# vendor/
23-
.idea/$CACHE_FILE$
24-
.idea/$PRODUCT_WORKSPACE_FILE$
25-
.idea/.gitignore
26-
.idea/codeStyles
27-
.idea/deployment.xml
28-
.idea/inspectionProfiles/
29-
.idea/kotlinc.xml
30-
.idea/misc.xml
31-
.idea/modules.xml
32-
asciicheck.iml
21+
/asciicheck

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.PHONY: clean check test build
2+
3+
default: clean check test build
4+
5+
clean:
6+
rm -rf dist/ cover.out
7+
8+
test: clean
9+
go test -v -cover ./...
10+
11+
check:
12+
golangci-lint run
13+
14+
build:
15+
go build -ldflags "-s -w" -trimpath ./cmd/asciicheck/

0 commit comments

Comments
 (0)