Skip to content

Commit 01182e8

Browse files
committed
ci: Update GitHub Actions for Testing raspberrypi
* Introduced a `test-raspberrypi-stable` job for testing `raspberrypi` devices. * Uses `actions/upload-artifact` and `actions/download-artifact` version 4. * Ref: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ * Unified Timestamp Management: * Standardized the use of a shared timestamp prefix across all jobs. * Added steps to generate, upload, and download the timestamp as an artifact. * Fixed workflow structure with `actions/checkout@v3` added where missing.
1 parent 6d0a7ed commit 01182e8

File tree

8 files changed

+138
-11
lines changed

8 files changed

+138
-11
lines changed

.ci/robot_framework/tests/tests_010_input_events.robot

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Test Timeout 60 seconds
33

44
Suite Setup Webdriver Remote Start --maximized
55
Suite Teardown Webdriver Remote Stop
6-
Suite Timeout 5 minutes
76

87
Library Collections
98
Library DocTest.VisualTest

.ci/robot_framework/tests/tests_011_glyphs.robot

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Test Timeout 30 seconds
77

88
Suite Setup Webdriver Remote Start
99
Suite Teardown Webdriver Remote Stop
10-
Suite Timeout 5 minutes
1110

1211
Library DocTest.VisualTest
1312
Library SeleniumLibrary

.ci/robot_framework/tests/tests_015_video.robot

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Test Timeout 300 seconds
44

55
Suite Setup Webdriver Remote Start --maximized
66
Suite Teardown Webdriver Remote Stop
7-
Suite Timeout 10 minutes
87

98
Library SeleniumLibrary
109

.ci/robot_framework/tests/tests_020_motionmark.robot

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Test Timeout 10 minutes
1010

1111
Suite Setup Webdriver Remote Start
1212
Suite Teardown Webdriver Remote Stop
13-
Suite Timeout 15 minutes
1413

1514
Library SeleniumLibrary
1615

.github/actions/bitbake-build/action.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ runs:
2626
echo "BITBAKE_TARGET=${{ inputs.bitbake_target }}"
2727
echo "RELEASE=${{ inputs.repo_release }}"
2828
echo "======================================================================"
29-
- name: Generate timestamped prefix
29+
- name: Download timestamp artifact
30+
uses: actions/download-artifact@v4
31+
with:
32+
pattern: timestamp.txt
33+
merge-multiple: true
34+
- name: Get timestamp prefix
3035
id: timestamp
3136
shell: bash
3237
run: |
33-
TIMESTAMP=$(date +"%Y%m%d%H%M")
34-
echo "prefix=${TIMESTAMP}" >> $GITHUB_OUTPUT
38+
TIMESTAMP=$(cat timestamp.txt)
39+
echo "timestamp=${TIMESTAMP}" >> $GITHUB_OUTPUT
3540
- name: Build
3641
shell: bash
3742
run: |
@@ -59,13 +64,13 @@ runs:
5964
shell: bash
6065
run: |
6166
ls -lh ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/${{ inputs.bitbake_buildname }}/tmp/deploy/images/${{ inputs.bitbake_machine }}/
62-
PREFIX=${{ steps.timestamp.outputs.prefix }}
67+
TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
6368
s3cmd put -F ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/${{ inputs.bitbake_buildname }}/tmp/deploy/images/${{ inputs.bitbake_machine }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.rootfs.wic.bmap \
64-
s3://yocto/${PREFIX}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.wic.bmap
69+
s3://yocto/${TIMESTAMP}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.wic.bmap
6570
s3cmd put -F ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/${{ inputs.bitbake_buildname }}/tmp/deploy/images/${{ inputs.bitbake_machine }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.rootfs.wic.bz2 \
66-
s3://yocto/${PREFIX}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.wic.bz2
71+
s3://yocto/${TIMESTAMP}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.wic.bz2
6772
s3cmd put -F ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/${{ inputs.bitbake_buildname }}/tmp/deploy/images/${{ inputs.bitbake_machine }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.rootfs-dbg.tar.bz2 \
68-
s3://yocto/${PREFIX}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.dbg.tar.bz2
73+
s3://yocto/${TIMESTAMP}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.dbg.tar.bz2
6974
- name: Clean the tmp dir
7075
if: always()
7176
shell: bash

.github/actions/bitbake-repo/action.yml

+12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ runs:
1717
echo "CI_COMMIT_SHA=${{ inputs.repo_ref }}"
1818
echo "CI_RELEASE=${{ inputs.repo_release }}"
1919
echo "======================================================================"
20+
- name: Generate timestamped prefix
21+
id: timestamp
22+
shell: bash
23+
run: |
24+
TIMESTAMP=$(date +"%Y%m%d%H%M")
25+
echo ${TIMESTAMP} > timestamp.txt
2026
- name: Set bitbake environment
2127
shell: bash
2228
run: |
@@ -35,3 +41,9 @@ runs:
3541
git checkout ${{ inputs.repo_ref }}
3642
git rebase tmp/main
3743
popd
44+
- name: Upload timestamp prefix artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: timestamp.txt
48+
path: timestamp.txt
49+
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
inputs:
2+
bitbake_buildname:
3+
default: 'build'
4+
bitbake_prefix:
5+
default: ''
6+
bitbake_machine:
7+
default: 'raspberrypi5'
8+
bitbake_target:
9+
default: 'core-image-weston-wpe'
10+
bitbake_source:
11+
default: 'source'
12+
github_token:
13+
required: true
14+
repo_release:
15+
default: 'scarthgap'
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Print environment
20+
shell: bash
21+
run: |
22+
echo "Environment:"
23+
echo "======================================================================"
24+
echo "BITBAKE_BUILDNAME=${{ inputs.bitbake_buildname }}"
25+
echo "BITBAKE_MACHINE=${{ inputs.bitbake_machine }}"
26+
echo "BITBAKE_PREFIX=${{ inputs.bitbake_prefix }}"
27+
echo "BITBAKE_SOURCE=${{ inputs.bitbake_source }}"
28+
echo "BITBAKE_TARGET=${{ inputs.bitbake_target }}"
29+
echo "RELEASE=${{ inputs.repo_release }}"
30+
echo "======================================================================"
31+
- name: Download timestamp artifact
32+
uses: actions/download-artifact@v4
33+
with:
34+
pattern: timestamp.txt
35+
merge-multiple: true
36+
- name: Get timestamped prefix
37+
id: timestamp
38+
shell: bash
39+
run: |
40+
TIMESTAMP=$(cat timestamp.txt)
41+
echo "timestamp=${TIMESTAMP}" >> $GITHUB_OUTPUT
42+
- name: Prepare the Robot-Framework related PODs in background
43+
shell: bash
44+
run: |
45+
pushd .ci
46+
podman rm ci_webserver_1 ci_robot_1 -f
47+
./podman-compose.sh up --force-recreate --always-recreate-deps --build -d
48+
popd
49+
- name: Flash
50+
shell: bash
51+
run: |
52+
TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
53+
s3cmd get -F s3://yocto/${TIMESTAMP}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.wic.bmap
54+
s3cmd get -F s3://yocto/${TIMESTAMP}-${{ inputs.bitbake_buildname }}/${{ inputs.bitbake_target }}-${{ inputs.bitbake_machine }}.wic.bz2
55+
sudo flash ${{ inputs.bitbake_target }} ${{ inputs.bitbake_machine }}
56+
- name: Test
57+
shell: bash
58+
run: |
59+
cd .ci
60+
IP=$(sudo manage-devices -c /etc/manage-devices.yml ip ${{ inputs.bitbake_machine }})
61+
echo "#!/bin/sh" > setup-env-local.sh
62+
echo "export TEST_BOARD_IP=${IP}" >> setup-env-local.sh
63+
echo "test_warning_detected=false" >> $GITHUB_ENV
64+
./run-tests.sh || {
65+
MESSAGE="Failures were detected in the test results in ${{ inputs.bitbake_buildname }} for ${{ inputs.bitbake_target }} with ${{ inputs.bitbake_machine }}"
66+
echo "::warning file=.ci/run-tests.sh,title=Robot Framework tests::${MESSAGE}"
67+
echo "test_warning_detected=true" >> $GITHUB_ENV
68+
echo "${MESSAGE}" > warning.txt
69+
}
70+
TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
71+
s3cmd put -r -F tests_results/robot s3://yocto/${TIMESTAMP}-${{ inputs.bitbake_buildname }}/
72+
- name: Comment on the pull request if there is a warning
73+
if: env.test_warning_detected == 'true'
74+
uses: mshick/add-pr-comment@v2
75+
with:
76+
message-path: |
77+
.ci/warning.txt
78+
- name: Clean the tests directory
79+
if: always()
80+
shell: bash
81+
run: |
82+
rm -rf .ci/setup-env-local.sh .ci/tests_results .ci/warning.txt

.github/workflows/test-build.yml

+32
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,43 @@ jobs:
3030
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request'"
3131
needs: scarthgap-repo
3232
steps:
33+
- uses: actions/checkout@v3
3334
- uses: ./.github/actions/bitbake-build
3435
with:
3536
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}
3637
bitbake_machine: ${{ matrix.machine }}
3738
bitbake_source: 'poky-wayland layers.raspberrypi conf.wpe-${{ matrix.wpe_vers }} --update-config'
3839
repo_release: ${{ matrix.yocto_rel }}
3940

41+
test-raspberrypi-stable:
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
machine: ['raspberrypi3-mesa', 'raspberrypi5']
46+
wpe_vers: ['2_46']
47+
yocto_rel: ['scarthgap']
48+
runs-on: [self-hosted, podman]
49+
permissions:
50+
pull-requests: write
51+
needs: build-raspberrypi-stable
52+
steps:
53+
- uses: actions/checkout@v3
54+
- uses: ./.github/actions/s3-configure
55+
env:
56+
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
57+
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
58+
S3_HOST_BASE: ${{ secrets.S3_HOST_BASE }}
59+
with:
60+
access_key: ${S3_ACCESS_KEY}
61+
secret_key: ${S3_SECRET_KEY}
62+
host_base: ${S3_HOST_BASE}
63+
- uses: ./.github/actions/podman-robot
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.github_token }}
66+
with:
67+
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}
68+
bitbake_machine: ${{ matrix.machine }}
69+
github_token: ${GITHUB_TOKEN}
4070

4171
build-raspberrypi-nightly:
4272
strategy:
@@ -50,6 +80,7 @@ jobs:
5080
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request' && !github.event.pull_request.draft"
5181
needs: scarthgap-repo
5282
steps:
83+
- uses: actions/checkout@v3
5384
- uses: ./.github/actions/bitbake-build
5485
with:
5586
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}
@@ -69,6 +100,7 @@ jobs:
69100
if: "!contains(github.event.head_commit.message, 'ci skip') && github.event_name == 'pull_request' && !github.event.pull_request.draft"
70101
needs: scarthgap-repo
71102
steps:
103+
- uses: actions/checkout@v3
72104
- uses: ./.github/actions/bitbake-build
73105
with:
74106
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}

0 commit comments

Comments
 (0)