-
Notifications
You must be signed in to change notification settings - Fork 65
162 lines (139 loc) · 4.93 KB
/
pull_request.yaml
File metadata and controls
162 lines (139 loc) · 4.93 KB
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
157
158
159
160
161
162
name: Build
on:
push:
branches:
- develop
paths-ignore:
- '*.md'
- .github/workflows/*.yaml
pull_request:
workflow_dispatch:
jobs:
custom-firmware-build:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
steps:
- name: Record start time
run: echo "JOB_START=$(date +%s)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image with cache
uses: docker/build-push-action@v6
with:
context: .github/dev
load: true
tags: snapmaker-u1-dev:latest
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: BUILDKIT_INLINE_CACHE=1
- name: Load values vars.mk
run: cat vars.mk >> "$GITHUB_ENV"
- name: Restore Firmwares Cache
id: cache-firmwares
uses: actions/cache/restore@v4
with:
path: firmware/
key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }}
- name: Restore Kernel Cache
id: cache-kernel
uses: actions/cache/restore@v4
with:
path: tmp/kernel/
key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }}
- name: Restore ccache
id: cache-ccache
uses: actions/cache/restore@v4
with:
path: tmp/ccache/
key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }}
restore-keys: |
ccache-${{ runner.os }}-${{ runner.arch }}-
- name: Restore downloads cache
id: cache-downloads
uses: actions/cache/restore@v4
with:
path: |
tmp/cache/**/.git
tmp/cache/**/*.zip
tmp/cache/**/*.gz
tmp/cache/**/*.xz
key: downloads-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }}
restore-keys: |
downloads-${{ runner.os }}-${{ runner.arch }}-
- name: Set GIT_VERSION (for branch)
shell: bash
if: github.event_name == 'push'
run: |
nextVer=$(./scripts/next_version.sh paxx12 test-branch-${{ github.ref_name }})
echo "GIT_VERSION=${nextVer//v/}" | tee -a $GITHUB_ENV
- name: Set GIT_VERSION (for Pull Request)
shell: bash
if: github.event_name == 'pull_request'
run: |
nextVer=$(./scripts/next_version.sh paxx12 test-pr-${{ github.event.pull_request.number }})
echo "GIT_VERSION=${nextVer//v/}" | tee -a $GITHUB_ENV
- name: Download firmware
run: ./dev.sh make firmware
- name: Build with Extended Fluidd firmware
run: ./dev.sh make build PROFILE=extended OUTPUT_FILE=U1_extended_${{ env.GIT_VERSION }}_upgrade.bin
- name: Build DEVEL version of Extended Fluidd firmware
run: ./dev.sh make build PROFILE=extended-devel OUTPUT_FILE=U1_extended_${{ env.GIT_VERSION }}_devel.bin
- uses: actions/upload-artifact@v4
with:
name: extended-build
path: U1_extended_*_upgrade.bin
- uses: actions/upload-artifact@v4
with:
name: extended-devel-build
path: U1_extended_*_devel.bin
- name: Save PR info
if: github.event_name == 'pull_request'
run: |
mkdir -p pr-info
echo "${{ github.event.pull_request.number }}" > pr-info/number
echo "${{ github.event.pull_request.head.sha }}" > pr-info/head_sha
echo "${{ github.sha }}" > pr-info/merge_sha
echo "${{ github.base_ref }}" > pr-info/base_ref
echo "${{ env.GIT_VERSION }}" > pr-info/version
echo "${{ env.JOB_START }}" > pr-info/job_start
echo "$(date +%s)" > pr-info/job_end
echo extended-build >> pr-info/artifacts
echo extended-devel-build >> pr-info/artifacts
- name: Upload PR info
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: pr-info
path: pr-info/
- name: Save Firmwares Cache
if: steps.cache-firmwares.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: firmware/
key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }}
- name: Save Kernel Cache
if: steps.cache-kernel.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: tmp/kernel/
key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }}
- name: Save ccache
uses: actions/cache/save@v4
with:
path: tmp/ccache/
key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }}
- name: Save downloads cache
uses: actions/cache/save@v4
with:
path: |
tmp/cache/**/.git
tmp/cache/**/*.zip
tmp/cache/**/*.gz
tmp/cache/**/*.xz
key: downloads-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }}