mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
ci for golang
This commit is contained in:
45
.github/workflows/main.yml
vendored
45
.github/workflows/main.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
repository: breez/breez-sdk
|
||||
ref: ${{ needs.setup.outputs.sdk-ref }}
|
||||
package-version: ${{ needs.setup.outputs.package-version }}
|
||||
packages-to-publish: '["csharp", "flutter"]'
|
||||
packages-to-publish: '["csharp", "flutter", "golang"]'
|
||||
use-dummy-binaries: true
|
||||
|
||||
check-rust:
|
||||
@@ -157,6 +157,49 @@ jobs:
|
||||
working-directory: snippets/csharp
|
||||
run: dotnet build
|
||||
|
||||
check-golang:
|
||||
needs:
|
||||
- setup
|
||||
- build-packages
|
||||
name: Check Go snippets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Download archived package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: breez-sdk-go-${{ needs.setup.outputs.package-version }}
|
||||
path: snippets/go/packages/breez-sdk-go
|
||||
|
||||
- name: Format the Go snippets
|
||||
working-directory: snippets/go
|
||||
run: go fmt
|
||||
|
||||
- name: Test formatted correctly
|
||||
working-directory: snippets/go
|
||||
run: |
|
||||
status=$(git status --porcelain)
|
||||
if [[ -n "$status" ]]; then
|
||||
echo "Git status has changes"
|
||||
echo "$status"
|
||||
git diff
|
||||
exit 1
|
||||
else
|
||||
echo "No changes in git status"
|
||||
fi
|
||||
|
||||
- name: Build the Go snippets
|
||||
working-directory: snippets/go
|
||||
run: |
|
||||
go get
|
||||
go build .
|
||||
|
||||
build:
|
||||
name: Build mdbook
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
5
snippets/go/.gitignore
vendored
5
snippets/go/.gitignore
vendored
@@ -23,4 +23,7 @@ go.work
|
||||
# Ignore Go binaries
|
||||
**/*
|
||||
!**/*.go
|
||||
!**/
|
||||
!**/*.md
|
||||
!**/
|
||||
|
||||
breez-sdk-go
|
||||
6
snippets/go/README.md
Normal file
6
snippets/go/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
## Steps to compile the snippets locally
|
||||
1. Build a golang package
|
||||
- By running the publish-all-platforms CI in the breez-sdk repository (use dummy binaries)
|
||||
- or by cloning https://github.com/breez/breez-sdk-go
|
||||
2. Place the files in the folder `snippets/go/packages/breez-sdk-go`
|
||||
3. Happy coding
|
||||
@@ -3,3 +3,4 @@ module main
|
||||
go 1.19
|
||||
|
||||
require github.com/breez/breez-sdk-go v0.2.7
|
||||
replace github.com/breez/breez-sdk-go => ./packages/breez-sdk-go
|
||||
|
||||
Reference in New Issue
Block a user