address image sending timeouts #474
Workflow file for this run
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
name: Flowzone | |
on: | |
pull_request: | |
types: [opened, synchronize, closed] | |
branches: [main, master] | |
# allow external contributions to use secrets within trusted code | |
pull_request_target: | |
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-personal, | |
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-22.04 | |
env: | |
SUITES: ./suites | |
REPORTS: ./reports | |
WORKSPACE: ./workspace | |
BALENACLOUD_ORG: testbot | |
BALENACLOUD_API_KEY: ${{ secrets.BALENA_TESTBOT_TOKEN }} | |
BALENACLOUD_APP_NAME: balena/testbot-rig | |
BALENACLOUD_API_URL: balena-cloud.com | |
ENVIRONMENT: ${{ matrix.ENVIRONMENT }} | |
BALENAMACHINE_API_KEY: ${{ secrets.BALENAMACHINE_API_KEY }} | |
BALENAMACHINE_API_URL: bm.balena-dev.com | |
BALENACLOUD_SSH_URL: ssh.devices.bm.balena-dev.com | |
BALENACLOUD_SSH_PORT: 222 | |
QEMU_CPUS: 1 | |
QEMU_MEMORY: 1G | |
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 | |
- DEVICE_TYPE: generic-amd64 | |
WORKER_TYPE: qemu | |
WORKER_APP_ID: "1941514" # balena/leviathan-worker-amd64 | |
- DEVICE_TYPE: generic-aarch64 | |
WORKER_TYPE: qemu | |
WORKER_APP_ID: "1941514" # balena/leviathan-worker-aarch64 | |
# 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
submodules: true | |
repository: balena-os/leviathan | |
ref: master | |
- name: Get worker release | |
env: | |
ENVIRONMENT: "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 }}/${{ 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_KEY_PUSH }}" | 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 | |
run: | | |
make config | |
make test || exit 1 | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # 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-22.04 | |
steps: | |
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
- name: Get worker release | |
env: | |
ENVIRONMENT: "balena-cloud.com" | |
VERSION: "v6" | |
WORKER_APP_ID: "1941517" # balena/leviathan-worker-armv7hf in balenaCloud | |
TAG_KEY: "balena-ci-commit-sha" | |
TAG_VALUE: ${{ github.event.pull_request.head.sha }} | |
run: | | |
url=() | |
url+=("https://api.${{ env.ENVIRONMENT }}/${{ env.VERSION }}/release") | |
url+=("?\$filter=") | |
url+=("(belongs_to__application%20eq%20${{ env.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_KEY_PUSH }}" | 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-armv7hf/${{ env.WORKER_RELEASE }} |' -i docker-compose.yml | |
cat docker-compose.yml | |
# - name: Describe git state | |
# id: git_describe | |
# shell: bash | |
# run: | | |
# describe="$(git describe HEAD --tags --always)" | |
# semver="$(npx -q -y -- semver -c -l "${describe}")" | |
# echo "semver=${semver}" >> $GITHUB_OUTPUT | |
- name: Deploy to balenaMachine | |
uses: balena-io/deploy-to-balena-action@master | |
with: | |
balena_token: ${{ secrets.BALENAMACHINE_API_KEY }} | |
fleet: balena/testbot-rig | |
environment: 'bm.balena-dev.com' | |
source: . |