diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..0fcc34e --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,35 @@ +--- + +name: build +on: + pull_request: + merge_group: + push: + branches: ['main'] + tags: ['v*'] + +permissions: + contents: read + +jobs: + build-cross: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install dependencies + shell: bash + run: sudo apt-get install -y golang make + - name: build + shell: bash + run: make cross + + build-native: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install dependencies + shell: bash + run: sudo apt-get install -y golang make + - name: build + shell: bash + run: make native diff --git a/.gitignore b/.gitignore index e1d66c3..0d774fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -bmc-test-go +bmc-test-* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ced8bec --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +all: cross native + +# the CGO_ENABLED=0 +# is used to not rely on libc, to use +# in on debian for the host, as it has different libc. + +native: + env CGO_ENABLED=0 go build -o bmc-test-x86 +cross: + env GOOS=linux GOARCH=arm GOARM=5 go build -o bmc-test-armv5 + ln -s -f bmc-test-armv5 bmc-test-cross + +clean: + rm -f bmc-test-cross bmc-test-armv5 bmc-test-x86 diff --git a/go.mod b/go.mod index f8c9cd0..399218a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/9elements/bmc-test-go -go 1.23.1 +go 1.23