Skip to content

Commit

Permalink
ci: Add basic ci build
Browse files Browse the repository at this point in the history
changed the go version to make the ci work.

The filename for the binary is chosen to match the existing tool.

Signed-off-by: Alexander Hansen <[email protected]>
  • Loading branch information
pointbazaar authored and AtomicFS committed Sep 12, 2024
1 parent e01e749 commit ca9882b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bmc-test-go
bmc-test-*
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/9elements/bmc-test-go

go 1.23.1
go 1.23

0 comments on commit ca9882b

Please sign in to comment.