name: CI on: push: branches: [master, main, develop] pull_request: branches: [master, main] env: GO_VERSION: '1.24' jobs: build: name: Build and Test runs-on: windows steps: - name: Checkout tutus-chain uses: actions/checkout@v4 with: path: tutus-chain - name: Checkout dependencies run: | # Add safe.directory to allow SYSTEM user to use these repos git config --global --add safe.directory C:/tutus-bolt git config --global --add safe.directory C:/tutus-consensus git config --global --add safe.directory C:/tutus-ordered-json git config --global --add safe.directory C:/tutus-rfc6979 # Clone or update dependency repos if (Test-Path C:\tutus-bolt) { Push-Location C:\tutus-bolt; git pull; Pop-Location } else { git clone https://git.marketally.com/tutus-one/tutus-bolt.git C:\tutus-bolt } if (Test-Path C:\tutus-consensus) { Push-Location C:\tutus-consensus; git pull; Pop-Location } else { git clone https://git.marketally.com/tutus-one/tutus-consensus.git C:\tutus-consensus } if (Test-Path C:\tutus-ordered-json) { Push-Location C:\tutus-ordered-json; git pull; Pop-Location } else { git clone https://git.marketally.com/tutus-one/tutus-ordered-json.git C:\tutus-ordered-json } if (Test-Path C:\tutus-rfc6979) { Push-Location C:\tutus-rfc6979; git pull; Pop-Location } else { git clone https://git.marketally.com/tutus-one/tutus-rfc6979.git C:\tutus-rfc6979 } - name: Update go.mod for CI working-directory: tutus-chain run: | (Get-Content go.mod) -replace '\.\./\.\./tutus-bolt', 'C:/tutus-bolt' | Set-Content go.mod (Get-Content go.mod) -replace '\.\./\.\./tutus-consensus', 'C:/tutus-consensus' | Set-Content go.mod (Get-Content go.mod) -replace '\.\./\.\./tutus-ordered-json', 'C:/tutus-ordered-json' | Set-Content go.mod (Get-Content go.mod) -replace '\.\./\.\./tutus-rfc6979', 'C:/tutus-rfc6979' | Set-Content go.mod - name: Download dependencies working-directory: tutus-chain run: | $env:CGO_ENABLED = "0" & "C:\Program Files\Go\bin\go.exe" mod download - name: Build working-directory: tutus-chain run: | $env:CGO_ENABLED = "0" & "C:\Program Files\Go\bin\go.exe" build -v -o bin/tutus.exe ./cli/main.go - name: Run tests working-directory: tutus-chain run: | $env:CGO_ENABLED = "0" & "C:\Program Files\Go\bin\go.exe" test -v -short ./... continue-on-error: true - name: Verify binary working-directory: tutus-chain run: | .\bin\tutus.exe --help