@@ -4,6 +4,31 @@ permissions:
44 contents : write
55
66jobs :
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 for Linux
15+ run : |
16+ GOOS=linux GOARCH=amd64 go build -o cli-v2-linux ./cli-v2.go
17+ - name : Build CLI for Windows
18+ run : |
19+ GOOS=windows GOARCH=amd64 go build -o cli-v2.exe ./cli-v2.go
20+ - name : Build CLI for macOS
21+ run : |
22+ GOOS=darwin GOARCH=amd64 go build -o cli-v2-macos ./cli-v2.go
23+ - name : Upload CLI binaries
24+ uses : actions/upload-artifact@v4
25+ with :
26+ name : cli-binaries
27+ path : |
28+ cli-v2-linux
29+ cli-v2.exe
30+ cli-v2-macos
31+
732 test :
833 runs-on : ubuntu-latest
934 steps :
2449 run : |
2550 bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r unit.coverage.out
2651
52+ ittest :
53+ needs : build
54+ runs-on : ${{ matrix.os }}
55+ strategy :
56+ matrix :
57+ os : [ubuntu-latest, windows-latest, macos-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+ # Disable windows it test for now.
85+ # - name: Install dependencies from .codacy/codacy.yaml (Windows)
86+ # if: matrix.os == 'windows-latest'
87+ # shell: pwsh
88+ # run: |
89+ # Get-ChildItem
90+ # Write-Host "Current directory contents:"
91+ # dir
92+ # Write-Host "Node.js version:"
93+ # node --version
94+ # Write-Host "Attempting to run CLI..."
95+ # .\cli-v2.exe install
96+
2797 release :
28- needs : test
98+ needs : [ test, ittest]
2999 if : github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.event_name == 'push'
30100 runs-on : ubuntu-latest
31101 steps :
0 commit comments