Skip to content

Update Lock file maintenance #979

Update Lock file maintenance

Update Lock file maintenance #979

Workflow file for this run

name: Flowzone
on:
pull_request:
types: [opened, synchronize, closed]
branches: [main, master]
jobs:
flowzone:
name: Flowzone
uses: product-os/flowzone/.github/workflows/flowzone.yml@master
# prevent duplicate workflows and only allow one `pull_request` or `pull_request_target` for
# internal or external contributions respectively
if: |
(github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') ||
(github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target')
secrets: inherit
with:
balena_slugs:
balena/testbot-rig,
balena/testbot-rig-partners,
balena/testbot-rig-partners-x86,
balena/leviathan-worker-amd64,
balena/leviathan-worker-aarch64,
balena/leviathan-worker-armv7hf
e2e:
needs: [flowzone]
if: |
((github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') ||
(github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target')) &&
github.event.action != 'closed'
runs-on: ubuntu-24.04
environment: ${{ matrix.ENVIRONMENT_URL }}
env:
SUITES: ./suites
REPORTS: ./reports
WORKSPACE: ./workspace
WORKER_TYPE: ${{ matrix.WORKER_TYPE }}
DEVICE_TYPE: ${{ matrix.DEVICE_TYPE }}
defaults:
run:
working-directory: .
shell: bash --noprofile --norc -eo pipefail -x {0}
strategy:
fail-fast: false
matrix:
include:
- DEVICE_TYPE: genericx86-64-ext
WORKER_TYPE: qemu
WORKER_APP_ID: "1941514" # balena/leviathan-worker-amd64
ENVIRONMENT_URL: balena-cloud.com
- DEVICE_TYPE: generic-amd64
WORKER_TYPE: qemu
WORKER_APP_ID: "1941514" # balena/leviathan-worker-amd64
ENVIRONMENT_URL: balena-cloud.com
- DEVICE_TYPE: generic-aarch64
WORKER_TYPE: qemu
WORKER_APP_ID: "1941514" # balena/leviathan-worker-aarch64
ENVIRONMENT_URL: balena-cloud.com
# Commented because testbot devices aren't available to test worker releases
# - DEVICE_TYPE: raspberrypi3
# WORKER_TYPE: testbot
# WORKER_APP_ID: "1941517" # balena/leviathan-worker-armv7hf
# - DEVICE_TYPE: raspberrypi4-64
# WORKER_TYPE: testbot
# WORKER_APP_ID: "1941515" # balena/leviathan-worker-aarch64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: true
repository: balena-os/leviathan
ref: master
persist-credentials: false
- name: Get worker release
env:
VERSION: "v6"
TAG_KEY: "balena-ci-commit-sha"
TAG_VALUE: ${{ github.event.pull_request.head.sha }}
run: |
url=()
url+=("https://api.${{ matrix.ENVIRONMENT_URL }}/${{ env.VERSION }}/release")
url+=("?\$filter=")
url+=("(belongs_to__application%20eq%20${{ matrix.WORKER_APP_ID }})")
url+=("%20and%20")
url+=("(")
url+=("(status%20eq%20%27success%27)")
url+=("%20and%20")
url+=("(release_tag/any(rt:(rt/tag_key%20eq%20%27${{ env.TAG_KEY }}%27)%20and%20(rt/value%20eq%20%27${{ env.TAG_VALUE }}%27)))")
url+=(")")
url+=("&\$orderby=created_at%20desc")
url+=("&\$select=commit")
url+=("&\$top=1")
commit="$(IFS= ; curl -fsSL -X GET "${url[*]}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.BALENA_API_DEPLOY_KEY }}" | jq -r '.d[].commit')"
test -n "${commit}" || exit 1
echo "WORKER_RELEASE=${commit}" >> $GITHUB_ENV
- name: Copy suite config
run: |
cp -a ${{ env.SUITES }}/config.js ${{ env.WORKSPACE }}/config.js
sed -r 's|(bh\.cr/balena/leviathan-worker(-[^/]+)?)/.+|\1/${{ env.WORKER_RELEASE }}|' -i docker-compose.qemu.yml
- name: Build leviathan images
run: make build
# - name: Select and repin a testbot worker
# if: ${{ env.DEVICE_TYPE }} == 'testbot'
# run: #TODO
- name: Run test suite
id: run-suite
env:
BALENACLOUD_API_KEY: ${{ secrets.BALENA_API_TEST_KEY }}
BALENACLOUD_API_URL: ${{ matrix.ENVIRONMENT_URL }}
BALENACLOUD_SSH_PORT: ${{ vars.BALENACLOUD_SSH_PORT }}
BALENACLOUD_SSH_URL: ${{ vars.BALENACLOUD_SSH_URL }}
DEVICE_TYPE: ${{ matrix.DEVICE_TYPE }}
WORKER_TYPE: ${{ matrix.WORKER_TYPE }}
QEMU_CPUS: 1
QEMU_MEMORY: "1G"
TEST_SUITE: e2e
BALENACLOUD_APP_NAME: ${{ vars.BALENACLOUD_APP_NAME }}
BALENACLOUD_ORG: ${{ vars.BALENACLOUD_ORG }}
REPORTS: ${{ env.REPORTS }}
SUITES: ${{ env.SUITES }}
WORKSPACE: ${{ env.WORKSPACE }}
run: |
make config
make test || exit 1
- uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3
if: steps.run-suite.conclusion == 'success'
with:
name: reports-${{ env.WORKER_TYPE }}-${{ env.DEVICE_TYPE }}
path: ${{ env.REPORTS }}
balenamachine-push:
needs: [flowzone]
runs-on: ubuntu-24.04
environment: "bm.balena-dev.com"
strategy:
fail-fast: false
matrix:
include:
- WORKER_APP_ID: "1941517" # balena/leviathan-worker-armv7hf
ARCHITECTURE: "armv7hf"
FLEET_NAME: "balena/testbot-rig"
- WORKER_APP_ID: "1941514" # balena/leviathan-worker-armv7hf
ARCHITECTURE: "amd64"
FLEET_NAME: "balena/testbot-rig-x86"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Get worker release
env:
ENVIRONMENT_URL: "balena-cloud.com"
VERSION: "v6"
TAG_KEY: "balena-ci-commit-sha"
TAG_VALUE: ${{ github.event.pull_request.head.sha }}
run: |
url=()
url+=("https://api.${{ env.ENVIRONMENT_URL }}/${{ env.VERSION }}/release")
url+=("?\$filter=")
url+=("(belongs_to__application%20eq%20${{ matrix.WORKER_APP_ID }})")
url+=("%20and%20")
url+=("(")
url+=("(status%20eq%20%27success%27)")
url+=("%20and%20")
url+=("(release_tag/any(rt:(rt/tag_key%20eq%20%27${{ env.TAG_KEY }}%27)%20and%20(rt/value%20eq%20%27${{ env.TAG_VALUE }}%27)))")
url+=(")")
url+=("&\$orderby=created_at%20desc")
url+=("&\$select=commit")
url+=("&\$top=1")
commit="$(IFS= ; curl -fsSL -X GET "${url[*]}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.BALENA_API_DEPLOY_KEY }}" | jq -r '.d[].commit')"
test -n "${commit}" || exit 1
echo "WORKER_RELEASE=${commit}" >> $GITHUB_ENV
- name: Update balenaMachine docker-compose.yml
shell: bash
run: |
sed -r 's|build: .|image: bh\.cr/balena/leviathan-worker-${{ matrix.ARCHITECTURE }}/${{ env.WORKER_RELEASE }} |' -i docker-compose.yml
cat docker-compose.yml
- name: Deploy to balenaOS balenaMachine testbot-rig
uses: balena-io/deploy-to-balena-action@master
with:
balena_token: ${{ secrets.BALENA_API_TEST_KEY }}
fleet: ${{ matrix.FLEET_NAME }}
environment: 'bm.balena-dev.com'
source: .