|
10 | 10 | branches: ["main"]
|
11 | 11 |
|
12 | 12 | jobs:
|
| 13 | + lint: |
| 14 | + name: Lint |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Go 1.19 |
| 21 | + uses: actions/setup-go@v5 |
| 22 | + with: |
| 23 | + go-version: '1.19' |
| 24 | + cache: false |
| 25 | + |
| 26 | + - name: Golangci-lint |
| 27 | + uses: golangci/golangci-lint-action@v4 |
| 28 | + with: |
| 29 | + version: latest |
| 30 | + args: --timeout 3m --verbose --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number |
| 31 | + only-new-issues: true |
13 | 32 | build:
|
14 |
| - runs-on: ubuntu-latest |
15 |
| - steps: |
16 |
| - - uses: actions/checkout@v3 |
17 |
| - |
18 |
| - - name: Set up Go |
19 |
| - uses: actions/setup-go@v3 |
20 |
| - with: |
21 |
| - go-version: 1.19 |
22 |
| - |
23 |
| - - name: Test with the Go CLI |
24 |
| - run: go test ./... |
25 |
| - |
26 |
| - - name: Golangci |
27 |
| - uses: golangci/golangci-lint-action@v3 |
28 |
| - with: |
29 |
| - # Require: The version of golangci-lint to use. |
30 |
| - # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. |
31 |
| - # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. |
32 |
| - version: latest |
33 |
| - |
34 |
| - # Optional: working directory, useful for monorepos |
35 |
| - # working-directory: somedir |
36 |
| - |
37 |
| - # Optional: golangci-lint command line arguments. |
38 |
| - # |
39 |
| - # Note: By default, the `.golangci.yml` file should be at the root of the repository. |
40 |
| - # The location of the configuration file can be changed by using `--config=` |
41 |
| - # args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0 |
42 |
| - |
43 |
| - args: --timeout 3m --verbose |
44 |
| - # Optional: show only new issues if it's a pull request. The default value is `false`. |
45 |
| - only-new-issues: true |
46 |
| - |
47 |
| - # Optional: if set to true, then all caching functionality will be completely disabled, |
48 |
| - # takes precedence over all other caching options. |
49 |
| - # skip-cache: true |
50 |
| - |
51 |
| - # Optional: if set to true, then the action won't cache or restore ~/go/pkg. |
52 |
| - # skip-pkg-cache: true |
53 |
| - |
54 |
| - # Optional: if set to true, then the action won't cache or restore ~/.cache/go-build. |
55 |
| - # skip-build-cache: true |
56 |
| - |
57 |
| - # Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. |
58 |
| - # install-mode: "goinstall" |
| 33 | + name: Build |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - name: Set up Go 1.x |
| 37 | + uses: actions/setup-go@v5 |
| 38 | + with: |
| 39 | + go-version: '1.19' |
| 40 | + cache: false |
| 41 | + |
| 42 | + - name: Check out code into the Go module directory |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Get dependencies |
| 46 | + run: | |
| 47 | + go get -v -t -d ./... |
| 48 | + - name: Test |
| 49 | + run: go test -v ./... |
0 commit comments