-
Notifications
You must be signed in to change notification settings - Fork 64
84 lines (73 loc) · 2.22 KB
/
gobuild-qemu-devices.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: tools/go-generate-qemu-device
on:
push:
branches: [staging]
pull_request:
types: [opened, synchronize, reopened]
branches: [staging]
paths:
- 'tools/go-generate-qemu-devices/**'
- '.github/workflows/gobuild-qemu-devices.yaml'
jobs:
# This job must run on the runner because hashFiles() operates on the runner
# by design, not inside the defined container (actions/runner#837).
go-vars:
runs-on: ubuntu-latest
outputs:
modhash: ${{ steps.gomod.outputs.hash }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.20.6
cache: false
- name: Set go.mod variable
id: goenv
run: |
cd tools/go-generate-qemu-devices
echo "mod=$(go env GOMOD)" >>"$GITHUB_OUTPUT"
- name: Set go.mod hash variable
id: gomod
run: echo "hash=${{ hashFiles(steps.goenv.outputs.mod) }}" >>"$GITHUB_OUTPUT"
build-qemu-devices:
runs-on: ubuntu-latest
needs: go-vars
container: kraftkit.sh/myself-full:latest
name: Build Check
env:
RUNGOGENERATE: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: 1.20.6
cache: false
- name: Set Go variables
id: goenv
run: |
cd tools/go-generate-qemu-devices
{
echo "cache=$(go env GOCACHE)"
echo "modcache=$(go env GOMODCACHE)"
} >>"$GITHUB_OUTPUT"
- name: Go caches
uses: actions/cache@v3
with:
path: |
${{ steps.goenv.outputs.cache }}
${{ steps.goenv.outputs.modcache }}
key: ${{ github.job }}-${{ runner.os }}-go-${{ needs.go-vars.outputs.modhash }}
restore-keys: |
${{ github.job }}-${{ runner.os }}-go-
- name: Build go-generate-qemu-devices
run: |
set -x
git config --global --add safe.directory /__w/kraftkit/kraftkit
cd tools/go-generate-qemu-devices
go build -o ../../dist/
- name: Run Help Message
run: |
set -x
./dist/go-generate-qemu-devices -h