Files
tools/.github/workflows/push.yml

50 lines
1.1 KiB
YAML

name: gokrazy CI
on:
push:
pull_request:
jobs:
build:
name: CI
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.24'
id: go
- name: Ensure all files were formatted as per gofmt
if: matrix.os == 'ubuntu-latest'
run: |
[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ]
- name: Build
run: |
go install -mod=mod ./cmd/...
- name: install qemu
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt-get install qemu-system-x86
- name: Run tests
if: matrix.os == 'ubuntu-latest'
# TestRelativeParentDir verifies breakglass.authorized_keys
# is correctly included, and the gok CLI only creates that
# file when it finds SSH keys.
run: |
mkdir -p ~/.ssh && echo dummy > ~/.ssh/id_ed25519.pub
go test -mod=mod -v ./...