Skip to content

Commit

Permalink
feat(BUX-420): CI/CD update for getting go version from go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-4chain committed Dec 19, 2023
1 parent ca40316 commit d86fb2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

- name: Install Go from go.mod
uses: actions/setup-go@v4
with:
go-version-file: go.mod

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ jobs:
golangci:
strategy:
matrix:
go-version: [1.19.x]
os: [ubuntu-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Go from go.mod
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -28,16 +31,15 @@ jobs:
build:
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go-version }}
- name: Set up Go from go.mod
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
go-version-file: go.mod

- name: Clean test cache
run: go clean -testcache
Expand All @@ -58,7 +60,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
Expand Down Expand Up @@ -100,7 +102,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: go.mod
- name: Make directory for darwin bin
run: |
mkdir -p ./artifacts/darwin
Expand Down

0 comments on commit d86fb2b

Please sign in to comment.