Skip to content

Commit bd78e2e

Browse files
authored
Merge pull request #1 from Gekko0114/ci
ci
2 parents 123f128 + fc6f554 commit bd78e2e

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

.github/workflows/commit.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "build"
2+
3+
on:
4+
push: # We run tests on non-tagged pushes to main
5+
tags: ''
6+
branches: main
7+
paths-ignore:
8+
- '**/*.md'
9+
pull_request: # We also run tests on pull requests targeted at the main branch.
10+
branches: main
11+
paths-ignore:
12+
- '**/*.md'
13+
# workflow_dispatch will let us manually trigger the workflow from GitHub actions dashboard.
14+
# For example, you can try to build a branch without raising a pull request.
15+
# See https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
16+
workflow_dispatch:
17+
18+
jobs:
19+
lint:
20+
runs-on: ubuntu-22.04
21+
strategy:
22+
matrix:
23+
go-version:
24+
- "1.22"
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: golangci/golangci-lint-action@v2
28+
- run: make lint
29+
30+
test:
31+
runs-on: ubuntu-22.04
32+
strategy:
33+
matrix:
34+
go-version:
35+
- "1.22"
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: actions/setup-go@v4
39+
with:
40+
go-version: ${{ matrix.go-version }}
41+
- run: make test

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: lint
2+
lint:
3+
golangci-lint run ./...
4+
5+
.PHONY: format
6+
fmt:
7+
go fmt ./...
8+
9+
.PHONY: test
10+
test:
11+
go test -v ./...

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module golangchain
2+
3+
go 1.22.4

pkg/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package main
2+
3+
func main() {
4+
println("aaa")
5+
}

0 commit comments

Comments
 (0)