File tree Expand file tree Collapse file tree 2 files changed +54
-45
lines changed
Expand file tree Collapse file tree 2 files changed +54
-45
lines changed Original file line number Diff line number Diff line change 4949 run : |
5050 bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r unit.coverage.out
5151
52- ittest :
53- needs : build
54- runs-on : ${{ matrix.os }}
55- strategy :
56- matrix :
57- os : [ubuntu-latest, macos-latest, windows-latest]
58- steps :
59- - name : Checkout
60- uses : actions/checkout@v4
61- - name : Download CLI binaries
62- uses : actions/download-artifact@v4
63- with :
64- name : cli-binaries
65- path : .
66- - name : Select correct binary
67- shell : bash
68- run : |
69- if [ "${{ matrix.os }}" = "windows-latest" ]; then
70- # Keep the .exe extension for Windows
71- echo "Using Windows binary with .exe extension"
72- elif [ "${{ matrix.os }}" = "macos-latest" ]; then
73- mv cli-v2-macos cli-v2
74- else
75- mv cli-v2-linux cli-v2
76- fi
77- - name : Make binary executable
78- if : matrix.os != 'windows-latest'
79- run : chmod +x cli-v2
80- - name : Install dependencies from .codacy/codacy.yaml
81- if : matrix.os != 'windows-latest'
82- run : |
83- ./cli-v2 install
84- - name : Install dependencies from .codacy/codacy.yaml (Windows)
85- if : matrix.os == 'windows-latest'
86- shell : pwsh
87- run : |
88- Get-ChildItem
89- Write-Host "Current directory contents:"
90- dir
91- Write-Host "Attempting to run CLI..."
92- .\cli-v2.exe install
93-
9452# For now we are not releasing the CLI, as we are making some quicker iterations
9553 release :
9654 needs : [test, ittest]
Original file line number Diff line number Diff line change 77 push :
88
99jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Go
17+ uses : actions/setup-go@v5
18+ with :
19+ go-version : ' 1.21'
20+ cache : true
21+
22+ - name : Build CLI for Linux
23+ run : |
24+ GOOS=linux GOARCH=amd64 go build -o cli-v2-linux ./cli-v2.go
25+
26+ - name : Build CLI for Windows
27+ run : |
28+ GOOS=windows GOARCH=amd64 go build -o cli-v2.exe ./cli-v2.go
29+
30+ - name : Build CLI for macOS
31+ run : |
32+ GOOS=darwin GOARCH=amd64 go build -o cli-v2-macos ./cli-v2.go
33+
34+ - name : Upload CLI binaries
35+ uses : actions/upload-artifact@v4
36+ with :
37+ name : cli-binaries
38+ path : |
39+ cli-v2-linux
40+ cli-v2.exe
41+ cli-v2-macos
42+
1043 test :
44+ needs : build
1145 runs-on : ${{ matrix.os }}
1246 strategy :
1347 matrix :
@@ -22,10 +56,27 @@ jobs:
2256 go-version : ' 1.21'
2357 cache : true
2458
25- - name : Build CLI
59+ - name : Download CLI binaries
60+ uses : actions/download-artifact@v4
61+ with :
62+ name : cli-binaries
63+ path : .
64+
65+ - name : Select correct binary
66+ shell : bash
2667 run : |
27- go build -o cli-v2 ./cli-v2.go
28- chmod +x cli-v2
68+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
69+ # Keep the .exe extension for Windows
70+ echo "Using Windows binary with .exe extension"
71+ elif [ "${{ matrix.os }}" = "macos-latest" ]; then
72+ mv cli-v2-macos cli-v2
73+ else
74+ mv cli-v2-linux cli-v2
75+ fi
76+
77+ - name : Make binary executable
78+ if : matrix.os != 'windows-latest'
79+ run : chmod +x cli-v2
2980
3081 - name : Run plugin tests
3182 id : run_tests
You can’t perform that action at this time.
0 commit comments