diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..f8d9781 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,59 @@ +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: | + git clone https://git.marketally.com/tutus-one/tutus-bolt.git C:\tutus-bolt + git clone https://git.marketally.com/tutus-one/tutus-consensus.git C:\tutus-consensus + git clone https://git.marketally.com/tutus-one/tutus-ordered-json.git C:\tutus-ordered-json + 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