Skip to content

Commit

Permalink
Merge pull request #363 from IMLS/xgo_build
Browse files Browse the repository at this point in the history
Xgo build
  • Loading branch information
Ben Klaas authored Mar 27, 2023
2 parents f206650 + c7ae620 commit b927d2f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/automate_arm_linux_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Linux ARM build

on:
push:
paths:
# only trigger the action if things are changing
# in the imls-wifi-sensor or in this yaml file
- 'imls-wifi-sensor/**'
- '.github/workflows/automate_arm_linux_build.yml'
pull_request:
paths:
- 'imls-wifi-sensor/**'
- '.github/workflows/automate_arm_linux_build.yml'

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
# use the go.mod and go.sum files for deps and versioning
go-version-file: imls-wifi-sensor/go.mod
cache-dependency-path: imls-wifi-sensor/go.sum
- name: build the executables
run: |
cd imls-wifi-sensor
# there is a special Makefile just for gh-actions
make -f Makefile.gh-actions all
- name: Upload the session counter
uses: actions/upload-artifact@v3
with:
name: linux-session-counter
path: imls-wifi-sensor/linux-session-counter
- name: Upload the hardware search cli tool
uses: actions/upload-artifact@v3
with:
name: wifi-hardware-search-cli
path: imls-wifi-sensor/wifi-hardware-search-cli

17 changes: 17 additions & 0 deletions imls-wifi-sensor/Makefile.gh-actions
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: all

#VERSION := $(shell git describe --tags --abbrev=0)
#LDFLAGS = "-X gsa.gov/18f/version.Semver=$(VERSION)"
LDFLAGS = "-X gsa.gov/18f/version.Semver=v3.5"
ENVVARS = GOOS=linux GOARCH=arm GOARM=7 GOBIN=/home/runner/work/estimating-wifi/estimating-wifi/imls-wifi-sensor

all: session-counter wifi-hardware-search-cli

deps:
go mod download

session-counter: deps
${ENVVARS} go build -ldflags $(LDFLAGS) gsa.gov/18f/cmd/linux-session-counter

wifi-hardware-search-cli: deps
${ENVVARS} go build -ldflags $(LDFLAGS) gsa.gov/18f/cmd/wifi-hardware-search-cli

0 comments on commit b927d2f

Please sign in to comment.