experiment #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} | |