-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (130 loc) · 4.89 KB
/
example.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
# Example of using firmware-action
name: coreboot build
on:
push:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
# Example of building coreboot
build-coreboot-example:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: firmware-action
uses: 9elements/[email protected]
with:
config: 'coreboot-example.json'
target: 'coreboot-example'
recursive: 'false'
- name: Get artifacts
uses: actions/upload-artifact@v4
with:
name: coreboot-4.19
path: output-coreboot
retention-days: 30
build-coreboot-linuxboot-example:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Fetch few missing submodules
run: |
git submodule update --depth 1 --init --recursive --checkout
#==================================
# Get commit hashes for submodules
#==================================
- name: Extract uroot commit sha
id: uroot_commit
run: |
echo "uroot_commit=$( git rev-parse HEAD:coreboot-linuxboot-example/u-root )" >> "${GITHUB_OUTPUT}"
- name: Extract Linux commit sha
id: linux_commit
run: |
echo "linux_commit=$( git rev-parse HEAD:coreboot-linuxboot-example/linux )" >> "${GITHUB_OUTPUT}"
- name: Extract Coreboot commit sha
id: coreboot_commit
run: |
echo "coreboot_commit=$( git rev-parse HEAD:coreboot-linuxboot-example/coreboot )" >> "${GITHUB_OUTPUT}"
#===============
# Restore cache
#===============
- name: Restore cached u-root artefact
uses: actions/cache/restore@v4
id: cache-uroot
with:
path: output-linuxboot-uroot
key: uroot-${{ steps.uroot_commit.outputs.uroot_commit }}-${{ hashFiles('coreboot-linuxboot-example.json') }}
- name: Restore cached Linux artefact
uses: actions/cache/restore@v4
id: cache-linux
with:
path: output-linuxboot-linux
key: linux-${{ steps.linux_commit.outputs.linux_commit }}-${{ hashFiles('coreboot-linuxboot-example.json', 'coreboot-linuxboot-example/linux_defconfig', 'output-linuxboot-uroot/*') }}
- name: Restore cached coreboot artefact
uses: actions/cache/restore@v4
id: cache-coreboot
with:
path: output-linuxboot-coreboot
key: coreboot-${{ steps.coreboot_commit.outputs.coreboot_commit }}-${{ hashFiles('coreboot-linuxboot-example.json', 'coreboot-linuxboot-example/coreboot_linuxboot_defconfig', 'output-linuxboot-linux/*') }}
#============================
# Build with firmware-action
#============================
- name: firmware-action
uses: 9elements/[email protected]
with:
config: 'coreboot-linuxboot-example.json'
target: 'coreboot-example-with-linuxboot'
recursive: 'true'
#==========================
# Upload artifacts - uroot
#==========================
- name: Cache u-root
uses: actions/cache/save@v4
if: always()
with:
key: uroot-${{ steps.uroot_commit.outputs.uroot_commit }}-${{ hashFiles('coreboot-linuxboot-example.json') }}
path: output-linuxboot-uroot
- name: Upload artifacts for uroot
uses: actions/upload-artifact@v4
if: always()
with:
name: linuxboot-uroot
path: output-linuxboot-uroot
#==========================
# Upload artifacts - Linux
#==========================
- name: Cache Linux
uses: actions/cache/save@v4
if: always()
with:
key: linux-${{ steps.linux_commit.outputs.linux_commit }}-${{ hashFiles('coreboot-linuxboot-example.json', 'coreboot-linuxboot-example/linux_defconfig', 'output-linuxboot-uroot/*') }}
path: output-linuxboot-linux
- name: Upload artifacts for Linux
uses: actions/upload-artifact@v4
if: always()
with:
name: linuxboot-linux
path: output-linuxboot-linux
#=============================
# Upload artifacts - coreboot
#=============================
- name: Cache coreboot
uses: actions/cache/save@v4
if: always()
with:
key: coreboot-${{ steps.coreboot_commit.outputs.coreboot_commit }}-${{ hashFiles('coreboot-linuxboot-example.json', 'coreboot-linuxboot-example/coreboot_linuxboot_defconfig', 'output-linuxboot-linux/*') }}
path: output-linuxboot-coreboot
- name: Upload artifacts for coreboot
uses: actions/upload-artifact@v4
if: always()
with:
name: linuxboot-coreboot
path: output-linuxboot-coreboot