gokrazy-cm3588-kernel/.github/workflows/testboot.yml
Anup Chenthamarakshan a1158e1ed2
Bump to min version 1.22 (#118)
automatically merged
2024-06-09 23:22:25 -07:00

67 lines
2.7 KiB
YAML

name: Testboot if labeled please-boot
on:
pull_request:
branches: [ main ]
types: [ labeled ]
jobs:
build:
name: CI
if: ${{ github.event.label.name == 'please-boot' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
# Run on the latest minor release of Go 1.22:
go-version: ~1.22
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Test Boot
env:
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GH_USER: ${{ secrets.GH_USER }}
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }}
TRAVIS_PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }}
BOOTERY_URL: ${{ secrets.BOOTERY_URL }}
BAKE_HOST: ${{ secrets.BAKE_HOST }}
GOKRAZY_BAKERY_PASSWORD: ${{ secrets.GOKRAZY_BAKERY_PASSWORD }}
GOKRAZY_BAKE_PASSWORD: ${{ secrets.GOKRAZY_BAKE_PASSWORD }}
if: ${{ env.GH_USER != 0 }}
run: |
mkdir -p extrafiles/github.com/gokrazy/breakglass/etc/
echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPrXgBg9kOZuG7j8ZkguxXbsJ5/bC1oILizs/BPsrF2c anupc@devbox' > extrafiles/github.com/gokrazy/breakglass/etc/breakglass.authorized_keys
mkdir -p flags/github.com/gokrazy/breakglass/
echo '-authorized_keys=/etc/breakglass.authorized_keys' > flags/github.com/gokrazy/breakglass/flags.txt
mkdir -p ~/.config/gokrazy
echo -n "${GOKRAZY_BAKERY_PASSWORD}" > ~/.config/gokrazy/http-password.txt
.github/workflows/create-bakery.bash
GOPROXY=direct go install github.com/gokrazy/autoupdate/cmd/...@latest
GOPROXY=direct go install github.com/gokrazy/tools/cmd/...@latest
gok -i bakery add .
if gokr-has-label please-boot; then
set -eu -o pipefail
echo "Ensuring rock64bake is running"
curl -s --max-time 300 "${BOOTERY_URL%/testboot}/power/"
poweroff_url="${BOOTERY_URL%/testboot}/power/off"
trap "curl -s --max-time 300 ${poweroff_url}" EXIT
echo "Updating u-boot"
curl -s --max-time 300 --upload-file u-boot.bin --user gokrazy:${GOKRAZY_BAKE_PASSWORD} http://${BAKE_HOST}/update/device-specific/u-boot.bin
echo "Test-booting"
cd ~/gokrazy/bakery && GOARCH=arm gokr-boot -require_label=please-boot -set_label=please-merge -bootery_url=$BOOTERY_URL
fi