Skip to content

Commit 42fe6d8

Browse files
Enhance GitHub Actions workflow to build and upload CLI binary before running tests, ensuring compatibility across multiple OS environments.
1 parent 15b023d commit 42fe6d8

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/go.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ permissions:
44
contents: write
55

66
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Set up Go
13+
uses: actions/setup-go@v4
14+
- name: Build CLI
15+
run: |
16+
go build ./cli-v2.go
17+
- name: Upload CLI binary
18+
uses: actions/upload-artifact@v3
19+
with:
20+
name: cli-binary
21+
path: cli-v2
22+
723
test:
24+
needs: build
825
runs-on: ${{ matrix.os }}
926
strategy:
1027
matrix:
@@ -14,9 +31,16 @@ jobs:
1431
uses: actions/checkout@v4
1532
- name: Set up Go
1633
uses: actions/setup-go@v4
34+
- name: Download CLI binary
35+
uses: actions/download-artifact@v3
36+
with:
37+
name: cli-binary
38+
path: .
39+
- name: Make binary executable
40+
if: matrix.os != 'windows-latest'
41+
run: chmod +x cli-v2
1742
- name: Install dependencies from .codacy/codacy.yaml
1843
run: |
19-
go build ./cli-v2.go
2044
./cli-v2 install
2145
- name: "Run tests"
2246
run: |

0 commit comments

Comments
 (0)