-
Notifications
You must be signed in to change notification settings - Fork 1
264 lines (211 loc) · 10.6 KB
/
experiment.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# WARNING: May be untested .
# ATTENTION: NOTICE: Consider replacing the current directory with a symlink to a larger filesystem, before checkout of repository.
name: experiment
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
actions: write
checks: read
contents: write
deployments: read
issues: none
packages: read
pull-requests: read
repository-projects: read
security-events: none
statuses: read
on:
#push:
workflow_dispatch:
inputs:
skimfast:
required: true
type: boolean
default: false
runnerName:
required: true
default: ubuntu-latest-m
type: choice
options:
- ubuntu-latest
- ubuntu-latest-m
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
#group: ${{ github.workflow }}-${{ github.ref }}
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build-analysis-beforeBoot:
runs-on: ubuntu-latest
steps:
- name: report! API Rate Limit
shell: bash
run: |
curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ""${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/rate_limit
#curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq -r ".rate"
- name: Maximize build space
#if: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 4125
#root-reserve-mb: 1625
temp-reserve-mb: 1950
#temp-reserve-mb: 50
swap-size-mb: 2
#remove-dotnet: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-dotnet: 'true'
#remove-android: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-android: 'true'
#remove-haskell: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-haskell: 'true'
#remove-codeql: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-codeql: 'true'
#remove-docker-images: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' }}
remove-docker-images: 'true'
- name: _getCore_ub
shell: bash
run: |
mkdir -p ~/core/infrastructure
cd ~/core/infrastructure
git clone --depth 1 --recursive https://github.com/mirage335-colossus/ubiquitous_bash.git
cd ubiquitous_bash
./_setupUbiquitous.bat
./ubiquitous_bash.sh _custom_splice_opensslConfig
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'recursive'
- name: mkdir _local
shell: bash
run: |
mkdir -p ./_local
- name: _getMinimal_cloud
shell: bash
run: |
! ./ubiquitous_bash.sh _getMinimal_cloud && exit 1
true
#! sudo -n apt-get -y clean && exit 1
df -h
df -h /
timeout-minutes: 355
- name: _getMost-aria2
shell: bash
run: |
sudo -n apt-get -y clean
sudo -n apt-get update
sudo -n env DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends -y aria2
timeout-minutes: 355
- name: _get_vmImg_beforeBoot_ubDistBuild
shell: bash
run: |
#export FORCE_AXEL=8
#./ubiquitous_bash.sh _get_vmImg_beforeBoot_ubDistBuild "latest"
# DANGER: Github Actions (strictly internal) ONLY!
#export FORCE_AXEL=8
export MANDATORY_HASH="true"
mkdir -p ./_local
cd ./_local
rm -f hash-download.txt
../ubiquitous_bash.sh _wget_githubRelease_join-stdout "soaringDistributions/ubDistBuild" "" "package_image_beforeBoot.tar.flx" 2> /dev/null | tee >(../ubiquitous_bash.sh _get_extract_ubDistBuild-tar --extract ./vm.img --to-stdout | env OPENSSL_CONF="/etc/ssl/openssl_legacy.cnf" openssl dgst -whirlpool -binary | xxd -p -c 256 > hash-download.txt) | ../ubiquitous_bash.sh _get_extract_ubDistBuild
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: _build_fallback_staging-buildYML-build
shell: bash
run: |
#! ./ubiquitous_bash.sh _openChRoot && exit 1
[[ -e _lib/_build-staging-ops.sh ]] && ! ./ubiquitous_bash.sh _build_fallback_staging-buildYML-build && exit 1
#! ./ubiquitous_bash.sh _closeChRoot && exit 1
true
#- name: fallocate --dig-holes
#shell: bash
#run: |
#fallocate --dig-holes ./_local/vm.img
#- name: _hash_img
#shell: bash
#run: |
#export skimfast=${{ github.event.inputs.skimfast }}
#echo $skimfast
##./ubiquitous_bash.sh _hash_img
#cat _local/hash-download.txt
- name: _zSpecial_report
shell: bash
continue-on-error: true
run: |
./ubiquitous_bash.sh _zSpecial_report
ls -l ./_local/grub.cfg
ls -l ./_local/grubenv
ls -l ./_local/dpkg
#ls -l ./_local/lsmodReport
ls -l ./_local/binReport
ls -l ./_local/coreReport
#ls -l ./_local/cfgFW.log
- name: analysis! missing-binaries
shell: bash
run: |
#echo -n
_safeEcho() {
printf '%s' "$1"
shift
[[ "$@" == "" ]] && return 0
local currentArg
for currentArg in "$@"
do
printf '%s' " "
printf '%s' "$currentArg"
done
return 0
}
#echo
_safeEcho_newline() {
_safeEcho "$@"
printf '\n'
}
mkdir -p ./_local/analysis
#cp ./_local/lsmodReport ./_local/analysis/lsmodReport-"$currentReleaseTag"
cp ./_local/binReport ./_local/analysis/binReport-"$currentReleaseTag"
cp ./_local/coreReport ./_local/analysis/coreReport-"$currentReleaseTag"
cp ./_local/dpkg ./_local/analysis/dpkg-"$currentReleaseTag"
cd ./_local/analysis
# Get the list of releases
RELEASES=$(curl -s -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/soaringDistributions/ubDistBuild/releases?per_page=100&page=1)
# Download binReport file for the current release
##curl -s -H "Authorization: token $GH_TOKEN" -L -o "lsmodReport-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/lsmodReport"
#curl -s -H "Authorization: token $GH_TOKEN" -L -o "binReport-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/binReport"
#curl -s -H "Authorization: token $GH_TOKEN" -L -o "coreReport-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/coreReport"
#curl -s -H "Authorization: token $GH_TOKEN" -L -o "dpkg-$currentReleaseTag" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$currentReleaseTag/dpkg"
# Loop through each release
#for RELEASE in $(_safeEcho_newline "$RELEASES" | jq -r '.[].tag_name' | sort --reverse); do
for RELEASE in $(_safeEcho_newline "$RELEASES" | jq -r 'sort_by(.published_at) | reverse | .[].tag_name' | tr -dc 'a-zA-Z0-9\-_.:\n'); do
# Compare the list of binaries in this release to the current release
if [ "$RELEASE" != "$currentReleaseTag" ]; then
# Download the binReport file for this release
#curl -s -H "Authorization: token $GH_TOKEN" -L -o "lsmodReport-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/lsmodReport"
curl -s -H "Authorization: token $GH_TOKEN" -L -o "binReport-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/binReport"
curl -s -H "Authorization: token $GH_TOKEN" -L -o "coreReport-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/coreReport"
curl -s -H "Authorization: token $GH_TOKEN" -L -o "dpkg-$RELEASE" "https://github.com/soaringDistributions/ubDistBuild/releases/download/$RELEASE/dpkg"
#echo | tee -a ./missing-lsmodReport
#echo "Binaries (lsmod) loaded in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-lsmodReport
#comm -23 <(sort "lsmodReport-$RELEASE") <(sort "lsmodReport-$currentReleaseTag") | tee -a ./missing-lsmodReport
echo | tee -a ./missing-binReport
echo "Binaries (filesystem) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-binReport
comm -23 <(sort "binReport-$RELEASE") <(sort "binReport-$currentReleaseTag") | tee -a ./missing-binReport
echo | tee -a ./missing-coreReport
echo "Binaries (core) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-coreReport
comm -23 <(sort "coreReport-$RELEASE" | grep -v '_local/h') <(sort "coreReport-$currentReleaseTag" | grep -v '_local/h') | tee -a ./missing-coreReport
echo | tee -a ./missing-dpkg
echo "Binaries (dpkg) in $RELEASE but not in currentRelease $currentReleaseTag:" | tee -a ./missing-dpkg
comm -23 <(sort "dpkg-$RELEASE") <(sort "dpkg-$currentReleaseTag") | tee -a ./missing-dpkg
fi
done
env:
currentReleaseTag: build-${{ github.run_id }}-${{ github.run_attempt }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CAUTION: Do NOT upload this analysis. Build is not yet complete. This analysis exists solely for more rapid diagnostics.
#- name: release! analysis! missing-binaries
#shell: bash
#run: |
#gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-lsmodReport
#gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-binReport
#gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-coreReport
#gh release upload build-${{ github.run_id }}-${{ github.run_attempt }} ./_local/analysis/missing-dpkg
#env:
#GH_TOKEN: ${{ github.token }}