From 4cb353b5e497661fb8d3263c69bfc7e45dcc4b96 Mon Sep 17 00:00:00 2001 From: iryndin Date: Mon, 4 Aug 2025 10:10:13 -0700 Subject: [PATCH 1/2] Add Github lint, build and test workflows --- .github/workflows/build_and_test.yml | 27 +++++++++++++++++++++++++ .github/workflows/golangci-lint.yml | 30 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/build_and_test.yml create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 0000000..a436b88 --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,27 @@ +name: Build project and run tests +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + build: + strategy: + matrix: + go: [ 1.23.x, 1.24.x ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up Go 1.21.x + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + cache-dependency-path: ./go.sum + - name: Install dependencies + run: go get . + - name: Build + run: ./build.sh + - name: Test + run: go test . + diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..0f7e9e5 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,30 @@ +name: golangci-lint +on: + push: + branches: + - main + - master + pull_request: + +permissions: + contents: read + # Optional: allow read access to pull requests. Use with `only-new-issues` option. + # pull-requests: read + +jobs: + golangci: + strategy: + matrix: + go: [1.23.x, 1.24.x] + os: [ubuntu-latest] + name: lint + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.1 \ No newline at end of file From 7124c0f2f4378989ccc50ee9b7b932f82d459258 Mon Sep 17 00:00:00 2001 From: iryndin Date: Mon, 4 Aug 2025 10:17:48 -0700 Subject: [PATCH 2/2] Fix --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index a436b88..73da2ca 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: go get . - name: Build - run: ./build.sh + run: go build - name: Test run: go test .