gokrazy-cm3588-kernel/.github/actions/testboot/action.yml

67 lines
2.7 KiB
YAML
Raw Normal View History

name: "Test boot"
description: "Test boot u-boot and kernel changes"
inputs:
github_repository:
required: true
gh_user:
required: true
gh_auth_token:
required: true
bootery_url:
required: true
bake_host:
required: true
gokrazy_bakery_password:
required: true
gokrazy_bake_password:
required: true
oauth-client-id:
required: true
oauth-secret:
required: true
runs:
using: "composite"
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ inputs.oauth-client-id }}
oauth-secret: ${{ inputs.oauth-secret }}
tags: tag:ci
- name: Test Boot
env:
GITHUB_REPOSITORY: ${{ inputs.github_repository }}
GH_USER: ${{ inputs.gh_user }}
GH_AUTH_TOKEN: ${{ inputs.gh_auth_token }}
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }}
TRAVIS_PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }}
BOOTERY_URL: ${{ inputs.bootery_url }}
BAKE_HOST: ${{ inputs.bake_host }}
GOKRAZY_BAKERY_PASSWORD: ${{ inputs.gokrazy_bakery_password }}
GOKRAZY_BAKE_PASSWORD: ${{ inputs.gokrazy_bake_password }}
if: ${{ env.GH_USER != 0 }}
shell: bash
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-rockchip.bin --user gokrazy:${GOKRAZY_BAKE_PASSWORD} http://${BAKE_HOST}/update/device-specific/u-boot-rockchip.bin
echo "Test-booting"
cd ~/gokrazy/bakery && gokr-boot -require_label=please-boot -set_label=please-merge -bootery_url=$BOOTERY_URL
fi