Skip to content

Commit 581e38e

Browse files
committed
chore: use GitHub Action
1 parent 596c5d8 commit 581e38e

File tree

5 files changed

+101
-6
lines changed

5 files changed

+101
-6
lines changed

.github/workflows/build.yml

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

.github/workflows/checks.yml

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

.travis.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# dupl [![Build Status](https://travis-ci.org/mibk/dupl.png)](https://travis-ci.org/mibk/dupl)
1+
# dupl
22

33
**dupl** is a tool written in Go for finding code clones. So far it can find clones only
44
in the Go source files. The method uses suffix tree for serialized ASTs. It ignores values
55
of AST nodes. It just operates with their types (e.g. `if a == 13 {}` and `if x == 100 {}` are
66
considered the same provided it exceeds the minimal token sequence size).
77

8-
Due to the used method dupl can report so called "false positives" on the output. These are
8+
Due to the used method dupl can report so-called "false positives" on the output. These are
99
the ones we do not consider clones (whether they are too small, or the values of the matched
1010
tokens are completely different).
1111

0 commit comments

Comments
 (0)