| 1 |
name: Go |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master ] |
| 6 |
pull_request: |
| 7 |
branches: [ master ] |
| 8 |
|
| 9 |
jobs: |
| 10 |
build-linux: |
| 11 |
name: Build (ubuntu-latest) |
| 12 |
runs-on: ubuntu-latest |
| 13 |
container: |
| 14 |
image: ubuntu:latest |
| 15 |
options: --privileged |
| 16 |
env: |
| 17 |
DEBIAN_FRONTEND: noninteractive |
| 18 |
|
| 19 |
steps: |
| 20 |
- name: Check out code into $GITHUB_WORKSPACE directory |
| 21 |
uses: actions/checkout@v2 |
| 22 |
|
| 23 |
- name: Set up Go |
| 24 |
uses: actions/setup-go@v2 |
| 25 |
with: |
| 26 |
go-version: ^1.19 |
| 27 |
id: go |
| 28 |
|
| 29 |
- name: Install Dependencies |
| 30 |
run: | |
| 31 |
apt-get update |
| 32 |
apt-get install -y gnome-keyring build-essential ca-certificates |
| 33 |
mkdir -p /github/home/.cache/ |
| 34 |
mkdir -p /github/home/.local/share/keyrings/ |
| 35 |
chmod 700 -R /github/home/.local/ |
| 36 |
|
| 37 |
- name: Get dependencies |
| 38 |
run: | |
| 39 |
go get -v -t -d ./... |
| 40 |
|
| 41 |
- name: Build |
| 42 |
run: | |
| 43 |
go build -v ./... |
| 44 |
|
| 45 |
- name: Test |
| 46 |
run: | |
| 47 |
echo 'somecredstorepass' | gnome-keyring-daemon --unlock |
| 48 |
go test -v ./... |
| 49 |
shell: dbus-run-session -- bash --noprofile --norc -eo pipefail {0} |
| 50 |
|
| 51 |
build-other: |
| 52 |
name: Build |
| 53 |
runs-on: ${{ matrix.os }} |
| 54 |
strategy: |
| 55 |
matrix: |
| 56 |
os: [macOS-latest, windows-latest] |
| 57 |
|
| 58 |
steps: |
| 59 |
- name: Check out code into $GITHUB_WORKSPACE directory |
| 60 |
uses: actions/checkout@v2 |
| 61 |
|
| 62 |
- name: Set up Go |
| 63 |
uses: actions/setup-go@v2 |
| 64 |
with: |
| 65 |
go-version: ^1.19 |
| 66 |
id: go |
| 67 |
|
| 68 |
- name: Get dependencies |
| 69 |
run: | |
| 70 |
go get -v -t -d ./... |
| 71 |
|
| 72 |
- name: Build |
| 73 |
run: | |
| 74 |
go build -v ./... |
| 75 |
|
| 76 |
- name: Test |
| 77 |
run: | |
| 78 |
go test -v ./... |
| 79 |
|
| 80 |
build-freebsd: |
| 81 |
name: Build (FreeBSD) |
| 82 |
runs-on: macos-12 |
| 83 |
|
| 84 |
steps: |
| 85 |
- uses: actions/checkout@v2 |
| 86 |
- name: Test in FreeBSD |
| 87 |
id: test |
| 88 |
uses: vmactions/[email protected] |
| 89 |
with: |
| 90 |
usesh: true |
| 91 |
prepare: pkg install -y go gnome-keyring |
| 92 |
run: | |
| 93 |
go version |
| 94 |
go build -v |
| 95 |
dbus-run-session -- sh -c "echo 'somecredstorepass' | gnome-keyring-daemon --unlock; go test -v ./..." |
| 96 |
# verify that we can build for freebsd with cgo disabled |
| 97 |
# This will disable the functionality as it depends on cgo (via |
| 98 |
# godbus) but should still be buildable to not break backwards |
| 99 |
# compatibility |
| 100 |
CGO_ENABLED=0 go build -v |