Skip to content

Commit

Permalink
use the test build config and script
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Jan 19, 2024
1 parent bf8c0f9 commit 33bdcd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test-amd64-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,40 @@ jobs:
echo "BRANCH_NAME: ${{env.BRANCH_NAME}}"
echo "GITHUB_USER: ${{steps.set_values.outputs.GITHUB_USER}}"
- name: Get Last Successful Workflow Run ID
- name: Get the last successful workflow run ID
id: get-run-id
run: |
RUN_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/raspiblitz/raspiblitz/actions/workflows/amd64-lean-image.yml/runs?branch=dev&status=success" \
| jq -r '.workflow_runs[0].id')
echo "RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT
- name: Get Artifact Download URL
- name: Get the artifact download URL
id: get-artifact-url
run: |
ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/raspiblitz/raspiblitz/actions/runs/${{ steps.get-run-id.outputs.RUN_ID }}/artifacts" \
| jq -r '.artifacts[0].archive_download_url')
echo "ARTIFACT_URL=$ARTIFACT_URL" >> $GITHUB_OUTPUT
- name: Download Artifact
- name: Download the artifact
run: |
curl -sS -L -o artifact.zip -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ steps.get-artifact-url.outputs.ARTIFACT_URL }}
- name: Decompress Image
- name: Decompress the image
run: |
unzip artifact.zip
ls -la
gzip -d raspiblitz-amd64-debian-lean.qcow2.gz
- name: Extract Checksum
- name: Extract the checksum
id: checksum
run: |
CHECKSUM=$(cat raspiblitz-amd64-debian-lean.qcow2.sha256 | awk '{print $1}')
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_OUTPUT
- name: Run the test script
- name: Mount the image and run the test.raspiblitz.sh
run: |
echo "Using the variables: --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.CHECKSUM}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}"
cd ci/amd64
bash packer.build.amd64-debian.sh --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.CHECKSUM}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}
bash test.amd64-debian.sh --image_link ${{github.workspace}}/raspiblitz-amd64-debian-lean.qcow2 --image_checksum ${{steps.checksum.outputs.CHECKSUM}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}
2 changes: 1 addition & 1 deletion ci/amd64/debian/scripts/test.raspiblitz.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh -eux

echo '# Check out the branch of the PR (passed down as an env variable)'
/home/admin/config.scripts/blitz.github.sh ${branch} ${github_user}
/home/admin/config.scripts/blitz.github.sh ${branch} ${github_user}

echo '# Test the installs'

Expand Down
2 changes: 1 addition & 1 deletion ci/amd64/debian/test.amd64-debian.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ source "qemu" "debian" {

disk_image = true
#TODO
image_path = "path/to/your/raspiblitz-amd64-debian-lean.qcow2"
image_path = "../../../raspiblitz-amd64-debian-lean.qcow2"

cpus = var.cpus
disk_size = var.disk_size
Expand Down

0 comments on commit 33bdcd9

Please sign in to comment.