Copy over CI config from gokrazy-odroidxu4-kernel

This commit is contained in:
Anup Chenthamarakshan 2024-07-04 14:14:36 -07:00
parent 64f04cc47e
commit c1d39c566b
3 changed files with 48 additions and 36 deletions

View File

@ -1,47 +1,47 @@
name: Testboot if labeled please-boot name: "Test boot"
description: "Test boot u-boot and kernel changes"
on: inputs:
pull_request: github_repository:
branches: [ main ] required: true
types: [ labeled ] gh_user:
required: true
jobs: gh_auth_token:
required: true
build: bootery_url:
name: CI required: true
if: ${{ github.event.label.name == 'please-boot' }} bake_host:
runs-on: ubuntu-latest 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: 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 - name: Tailscale
uses: tailscale/github-action@v2 uses: tailscale/github-action@v2
with: with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-client-id: ${{ inputs.oauth-client-id }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} oauth-secret: ${{ inputs.oauth-secret }}
tags: tag:ci tags: tag:ci
- name: Test Boot - name: Test Boot
env: env:
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} GITHUB_REPOSITORY: ${{ inputs.github_repository }}
GH_USER: ${{ secrets.GH_USER }} GH_USER: ${{ inputs.gh_user }}
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }} GH_AUTH_TOKEN: ${{ inputs.gh_auth_token }}
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }} TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }}
TRAVIS_PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }} TRAVIS_PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }}
BOOTERY_URL: ${{ secrets.BOOTERY_URL }} BOOTERY_URL: ${{ inputs.bootery_url }}
BAKE_HOST: ${{ secrets.BAKE_HOST }} BAKE_HOST: ${{ inputs.bake_host }}
GOKRAZY_BAKERY_PASSWORD: ${{ secrets.GOKRAZY_BAKERY_PASSWORD }} GOKRAZY_BAKERY_PASSWORD: ${{ inputs.gokrazy_bakery_password }}
GOKRAZY_BAKE_PASSWORD: ${{ secrets.GOKRAZY_BAKE_PASSWORD }} GOKRAZY_BAKE_PASSWORD: ${{ inputs.gokrazy_bake_password }}
if: ${{ env.GH_USER != 0 }} if: ${{ env.GH_USER != 0 }}
shell: bash
run: | run: |
mkdir -p extrafiles/github.com/gokrazy/breakglass/etc/ 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 echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPrXgBg9kOZuG7j8ZkguxXbsJ5/bC1oILizs/BPsrF2c anupc@devbox' > extrafiles/github.com/gokrazy/breakglass/etc/breakglass.authorized_keys
@ -62,5 +62,5 @@ jobs:
echo "Updating u-boot" 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 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" echo "Test-booting"
cd ~/gokrazy/bakery && GOARCH=arm gokr-boot -require_label=please-boot -set_label=please-merge -bootery_url=$BOOTERY_URL cd ~/gokrazy/bakery && gokr-boot -require_label=please-boot -set_label=please-merge -bootery_url=$BOOTERY_URL
fi fi

View File

@ -10,7 +10,7 @@ cat > ~/gokrazy/bakery/config.json <<EOT
"Update": { "Update": {
"HTTPPassword": "${GOKRAZY_BAKERY_PASSWORD}" "HTTPPassword": "${GOKRAZY_BAKERY_PASSWORD}"
}, },
"DeviceType": "odroidhc1", "DeviceType": "rock64",
"Packages": [ "Packages": [
"github.com/gokrazy/breakglass", "github.com/gokrazy/breakglass",
"github.com/gokrazy/bakery/cmd/bake", "github.com/gokrazy/bakery/cmd/bake",

View File

@ -38,3 +38,15 @@ jobs:
GOPROXY=direct go install github.com/gokrazy/autoupdate/cmd/...@latest GOPROXY=direct go install github.com/gokrazy/autoupdate/cmd/...@latest
GOPROXY=direct go install github.com/gokrazy/tools/cmd/gokr-packer@latest GOPROXY=direct go install github.com/gokrazy/tools/cmd/gokr-packer@latest
if ! gokr-has-label please-merge && ! gokr-has-label please-boot; then go install ./cmd/gokr-rebuild-kernel ./cmd/gokr-rebuild-uboot && gokr-rebuild-kernel -overwrite_container_executable=docker && gokr-rebuild-uboot -overwrite_container_executable=docker && GOPROXY=direct go install github.com/gokrazy/autoupdate/cmd/gokr-amend@latest && gokr-amend -set_label=please-boot *.dtb vmlinuz u-boot*.bin boot.scr; fi if ! gokr-has-label please-merge && ! gokr-has-label please-boot; then go install ./cmd/gokr-rebuild-kernel ./cmd/gokr-rebuild-uboot && gokr-rebuild-kernel -overwrite_container_executable=docker && gokr-rebuild-uboot -overwrite_container_executable=docker && GOPROXY=direct go install github.com/gokrazy/autoupdate/cmd/gokr-amend@latest && gokr-amend -set_label=please-boot *.dtb vmlinuz u-boot*.bin boot.scr; fi
- uses: ./.github/actions/testboot
with:
github_repository: ${{ secrets.GITHUB_REPOSITORY }}
gh_user: ${{ secrets.GH_USER }}
gh_auth_token: ${{ secrets.GH_AUTH_TOKEN }}
bootery_url: ${{ secrets.BOOTERY_URL }}
bake_host: ${{ secrets.BAKE_HOST }}
gokrazy_bakery_password: ${{ secrets.GOKRAZY_BAKERY_PASSWORD }}
gokrazy_bake_password: ${{ secrets.GOKRAZY_BAKE_PASSWORD }}
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}