File tree Expand file tree Collapse file tree 5 files changed +74
-12
lines changed Expand file tree Collapse file tree 5 files changed +74
-12
lines changed Original file line number Diff line number Diff line change 11name : ' Test modifying a Raspberry Pi image'
22on :
3- push :
4- branches :
5- - ' main'
6- - ' releases/**'
7- pull_request :
3+ # push:
4+ # branches:
5+ # - 'main'
6+ # - 'releases/**'
7+ # pull_request:
88 workflow_dispatch :
99
1010jobs :
Original file line number Diff line number Diff line change @@ -27,16 +27,22 @@ jobs:
2727 - name : Compress image
2828 run : |
2929 imagedir=$(dirname ${{ steps.build_image.outputs.image }})
30- tardir=${RUNNER_TEMP} /photonvision_rubikpi3
30+ tardir=. /photonvision_rubikpi3
3131 mkdir --parents ${tardir}
32- if ls ${imagedir}*.tar.gz 1>/dev/null 2>&1; then
33- sudo tar -xzf ${imagedir}*.tar.gz -C ${tardir}
32+ echo "Contents of imagedir: ${imagedir}"
33+ ls -la ${imagedir}
34+ if ls ${imagedir}/*.tar.gz 1>/dev/null 2>&1; then
35+ sudo tar -xzf ${imagedir}/*.tar.gz -C ${tardir} --strip-components=1
3436 fi
3537 sudo mv ${imagedir}/rawprogram*.xml ${tardir}/ 2>/dev/null || true
3638 sudo mv ${imagedir}/dtb.bin ${tardir}/ 2>/dev/null || true
3739 sudo mv ${imagedir}/*.img ${tardir}/ 2>/dev/null || true
40+ echo "Before cleanup contents of tardir: ${tardir}"
41+ ls -la ${tardir}
3842 sudo find ${tardir} -mindepth 2 -type f -exec mv {} ${tardir}/ \;
3943 sudo find ${tardir} -mindepth 1 -type d -empty -delete
44+ echo "After cleanup contents of tardir: ${tardir}"
45+ ls -la ${tardir}
4046 sudo tar -I 'xz -T0' -cf ./photonvision_rubikpi3.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
4147 - uses : actions/upload-artifact@v4
4248 with :
Original file line number Diff line number Diff line change 1+ name : ' Test modifying a Rubik Pi tar image'
2+ on :
3+ push :
4+ branches :
5+ - ' main'
6+ - ' releases/**'
7+ pull_request :
8+ workflow_dispatch :
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-24.04-arm
13+ steps :
14+ - uses : actions/checkout@v4
15+ - uses : ./
16+ with :
17+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/Dev/photonvision_rubikpi3.tar.xz
18+ minimum_free_mb : 2000
19+ root_location : " offset=569376768"
20+ shrink_image : " no"
21+ commands : |
22+ echo "Testing Rubik Pi tar image"
23+ uname -a
24+ lsblk
25+ echo "${loopdev}"
26+ id : build_image
27+ - name : Compress image
28+ run : |
29+ imagedir=$(dirname ${{ steps.build_image.outputs.image }})
30+ echo "Imagedir: ${imagedir}"
31+ ls -la ${imagedir}
32+ tardir=./photonvision_rubikpi3
33+ mkdir --parents ${tardir}
34+ echo "Tardir: ${tardir}"
35+ ls -la ${tardir}
36+ sudo mv ${imagedir}/* ${tardir}/
37+ echo "After move"
38+ ls -la ${tardir}
39+ sudo tar -I 'xz -T0' -cf ./photonvision_rubikpi3.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
40+ - uses : actions/upload-artifact@v4
41+ with :
42+ name : photonvision_rubikpi3.tar.xz
43+ path : ./photonvision_rubikpi3.tar.xz
44+ compression-level : 0
45+ if-no-files-found : error
46+ retention-days : 1
47+
48+
Original file line number Diff line number Diff line change 6161
6262 cat >> "${scriptdir}/commands.sh" << EOF
6363 #!/bin/bash
64+ set -x
6465 # set -exo pipefail
6566 # export SHELLOPTS
6667 # export BASHOPTS
Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -euo pipefail
2+ set -euxo pipefail
33
44url=$1
55download_path=" ${RUNNER_TEMP} /image"
3030fi
3131
3232echo " Image: ${image} "
33-
34- ls -l ${download_path}
33+ ls -la ${download_path}
3534
3635if [[ ${image} = * .xz ]]; then
3736 echo " Unzipping ${image} "
3837 unxz ${image}
3938 image=${image% .xz}
4039fi
4140
42- ls -l ${download_path}
41+ if [[ ${image} = * .tar ]]; then
42+ echo " Untarring ${image} "
43+ tar -xf ${image}
44+ rm ${image}
45+ image=$( find . -type f \( -name ' *.img' \) -exec ls -s {} + 2> /dev/null | sort -rn | head -n1 | awk ' {print $2}' )
46+ fi
47+
48+ echo " Image: ${image} "
49+ ls -la $( dirname ${image} )
4350
4451if [[ ${image} != * .img ]]; then
4552 echo " ${image} isn't a valid image file"
You can’t perform that action at this time.
0 commit comments