From c8ba304372d94a193e8856e65355db9b0b4735ad Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 16:46:01 +0200 Subject: [PATCH 01/10] Test unix path --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f40634e..8f25d45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,4 +13,4 @@ jobs: - uses: actions/checkout@v3 - name: Run a one-line script - run: echo "::error file=.github\workflows\test.yml,line=10,col=4::some issue (sample-linter)" + run: echo "::error file=.github/workflows/test.yml,line=10,col=4::some issue (sample-linter)" From 2c94ad708dc804298b00438f4bcfdb8781e32e97 Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 16:49:13 +0200 Subject: [PATCH 02/10] Test windows path --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f25d45..f40634e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,4 +13,4 @@ jobs: - uses: actions/checkout@v3 - name: Run a one-line script - run: echo "::error file=.github/workflows/test.yml,line=10,col=4::some issue (sample-linter)" + run: echo "::error file=.github\workflows\test.yml,line=10,col=4::some issue (sample-linter)" From 96c5a06218837526307e8a2ef3c7e4df68c39988 Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 16:50:37 +0200 Subject: [PATCH 03/10] Add line --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f40634e..4ebcf82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,7 @@ jobs: build: runs-on: windows-latest steps: + - uses: actions/checkout@v3 - name: Run a one-line script From 1d87b330a5d798b86d1de9ef985a6fc16870706e Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 16:52:28 +0200 Subject: [PATCH 04/10] Add line --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ebcf82..62c9e16 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,4 +14,5 @@ jobs: - uses: actions/checkout@v3 - name: Run a one-line script + run: echo "::error file=.github\workflows\test.yml,line=10,col=4::some issue (sample-linter)" From 757ab0fe9282b8de603c56c59fe2984893022cf1 Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 16:53:44 +0200 Subject: [PATCH 05/10] Escape slash --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62c9e16..edf937f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,4 +15,4 @@ jobs: - name: Run a one-line script - run: echo "::error file=.github\workflows\test.yml,line=10,col=4::some issue (sample-linter)" + run: echo "::error file=.github\\workflows\\test.yml,line=10,col=4::some issue (sample-linter)" From 322a07416291e587522b35892129bf618137257a Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 16:59:38 +0200 Subject: [PATCH 06/10] Add golangci-lint --- .github/workflows/test.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index edf937f..b0d8f99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,12 +7,19 @@ on: workflow_dispatch: jobs: - build: + golangci: + name: lint runs-on: windows-latest steps: - - - uses: actions/checkout@v3 - - - name: Run a one-line script - - run: echo "::error file=.github\\workflows\\test.yml,line=10,col=4::some issue (sample-linter)" + - name: Checkout code + uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: "1.21.x" + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: --timeout=12m From d4ceeb479c736e9b68ee7004be243b576be7f9cc Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 17:03:01 +0200 Subject: [PATCH 07/10] Add code --- .github/workflows/test.yml | 13 ++++++++----- go.mod | 3 +++ main.go | 11 +++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 go.mod create mode 100644 main.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0d8f99..10ad487 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,14 @@ -name: CI on: push: - branches: [ "main" ] + branches: + - master + - main pull_request: - branches: [ "main" ] - workflow_dispatch: + +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read jobs: golangci: @@ -22,4 +26,3 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: latest - args: --timeout=12m diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..db7878f --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/surik/test-github-annotations + +go 1.21.1 diff --git a/main.go b/main.go new file mode 100644 index 0000000..30d7a78 --- /dev/null +++ b/main.go @@ -0,0 +1,11 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello") +} + +func f() (*string, error) { + return nil, nil +} From 6a2489c88b7832ba131f5324c5c9bbfed4d431c1 Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 17:05:56 +0200 Subject: [PATCH 08/10] Add timeout --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10ad487..442a4b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,7 @@ jobs: golangci: name: lint runs-on: windows-latest + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v3 @@ -26,3 +27,4 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: latest + args: --timeout=12m From da0b353c40445037348458fab709ead76bea863f Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 17:11:14 +0200 Subject: [PATCH 09/10] Move to main folder --- main.go => main/main.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename main.go => main/main.go (100%) diff --git a/main.go b/main/main.go similarity index 100% rename from main.go rename to main/main.go From fbbbfeed57fbbafe8a6e0a096445393d3b95709c Mon Sep 17 00:00:00 2001 From: Yury Gargay Date: Sun, 22 Oct 2023 17:57:23 +0200 Subject: [PATCH 10/10] Run on ubuntu --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 442a4b9..dbf19ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ permissions: jobs: golangci: name: lint - runs-on: windows-latest + runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout code