Skip to content

Commit b6216b1

Browse files
committed
ci: Adding S3 storage
1 parent 02d712a commit b6216b1

File tree

3 files changed

+118
-49
lines changed

3 files changed

+118
-49
lines changed

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

+38-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
inputs:
2+
bitbake_buildname:
3+
default: 'build'
24
bitbake_prefix:
35
default: ''
6+
bitbake_machine:
7+
default: 'raspberrypi5'
48
bitbake_target:
59
default: 'core-image-weston-wpe'
610
bitbake_source:
@@ -15,27 +19,55 @@ runs:
1519
run: |
1620
echo "Environment:"
1721
echo "======================================================================"
22+
echo "BITBAKE_BUILDNAME=${{ inputs.bitbake_buildname }}"
23+
echo "BITBAKE_MACHINE=${{ inputs.bitbake_machine }}"
1824
echo "BITBAKE_PREFIX=${{ inputs.bitbake_prefix }}"
1925
echo "BITBAKE_SOURCE=${{ inputs.bitbake_source }}"
2026
echo "BITBAKE_TARGET=${{ inputs.bitbake_target }}"
2127
echo "RELEASE=${{ inputs.repo_release }}"
2228
echo "======================================================================"
29+
- name: Generate timestamped prefix
30+
id: timestamp
31+
shell: bash
32+
run: |
33+
TIMESTAMP=$(date +"%Y%m%d%H%M")
34+
echo "prefix=${TIMESTAMP}" >> $GITHUB_OUTPUT
2335
- name: Build
2436
shell: bash
2537
run: |
2638
cd ~/yocto-meta-wpe-image-${{ inputs.repo_release }}
27-
rm -rf tmp
2839
ulimit -n 4096
29-
#source sources/meta-wpe-image/scripts/setup-environment ${{ inputs.bitbake_source }}
30-
source setup-environment ${{ inputs.bitbake_source }}
40+
source sources/meta-wpe-image/scripts/setup-environment ${{ inputs.bitbake_buildname}} ${{ inputs.bitbake_machine }} ${{ inputs.bitbake_source }}
41+
MAX_RETRIES=5
42+
export ${{ inputs.bitbake_prefix }}
43+
for i in $(seq 1 $MAX_RETRIES); do
44+
echo "Attempt $i to fetch sources for $IMAGE..."
45+
if bitbake ${{ inputs.bitbake_target }} --runall=fetch; then
46+
echo "All sources fetched successfully."
47+
break
48+
fi
49+
50+
if [ $i -lt $MAX_RETRIES ]; then
51+
echo "Retrying fetch process..."
52+
else
53+
echo "Max retries reached. Some sources may still be missing."
54+
fi
55+
done
3156
${{ inputs.bitbake_prefix }} bitbake ${{ inputs.bitbake_target }}
3257
- name: Artifacts
3358
if: always()
3459
shell: bash
35-
run: |
36-
ls -lh ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/*/tmp/deploy/images/*/
60+
run: |
61+
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 }}
63+
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
65+
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
67+
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
3769
- name: Clean the tmp dir
3870
if: always()
3971
shell: bash
4072
run: |
41-
rm -rf ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/*/tmp
73+
rm -rf ~/yocto-meta-wpe-image-${{ inputs.repo_release }}/builds/${{ inputs.bitbake_buildname }}/tmp
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
inputs:
2+
access_key:
3+
description: "S3 Access Key"
4+
required: true
5+
secret_key:
6+
description: "S3 Secret Key"
7+
required: true
8+
host_base:
9+
description: "S3 Host base"
10+
required: false
11+
default: "ams3.digitaloceanspaces.com"
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Configure s3cmd
17+
shell: bash
18+
run: |
19+
cat > ~/.s3cfg <<EOL
20+
[default]
21+
access_key = ${{ inputs.access_key }}
22+
secret_key = ${{ inputs.secret_key }}
23+
host_base = ${{ inputs.host_base }}
24+
host_bucket = %(bucket)s.${{ inputs.host_base }}
25+
use_https = True
26+
gpg_command = /usr/bin/gpg
27+
EOL
28+

.github/workflows/test-build.yml

+52-43
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,73 @@ jobs:
66
if: "!contains(github.event.head_commit.message, 'ci skip')"
77
steps:
88
- uses: actions/checkout@v3
9+
- uses: ./.github/actions/s3-configure
10+
env:
11+
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
12+
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
13+
S3_HOST_BASE: ${{ secrets.S3_HOST_BASE }}
14+
with:
15+
access_key: ${S3_ACCESS_KEY}
16+
secret_key: ${S3_SECRET_KEY}
17+
host_base: ${S3_HOST_BASE}
918
- uses: ./.github/actions/bitbake-repo
1019
with:
1120
repo_release: 'scarthgap'
1221

13-
matrix-build-image:
22+
matrix-build-image-raspberrypi-stable:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
machine: ['raspberrypi3-mesa', 'raspberrypi4-64-mesa', 'raspberrypi5']
27+
wpe_vers: ['2_46']
28+
yocto_rel: ['scarthgap']
29+
runs-on: [self-hosted, builder]
30+
if: "!contains(github.event.head_commit.message, 'ci skip')"
31+
needs: scarthgap-repo
32+
steps:
33+
- uses: ./.github/actions/bitbake-build
34+
with:
35+
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}
36+
bitbake_machine: ${{ matrix.machine }}
37+
bitbake_source: 'poky-wayland layers.raspberrypi conf.wpe-${{ matrix.wpe_vers }} --update-config'
38+
repo_release: ${{ matrix.yocto_rel }}
39+
40+
41+
matrix-build-image-raspberrypi-nightly:
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
machine: ['raspberrypi3-mesa', 'raspberrypi4-64-mesa', 'raspberrypi5']
46+
wpe_vers: ['nightly']
47+
yocto_rel: ['scarthgap']
48+
continue-on-error: true
49+
runs-on: [self-hosted, builder]
50+
if: "!contains(github.event.head_commit.message, 'ci skip')"
51+
needs: scarthgap-repo
52+
steps:
53+
- uses: ./.github/actions/bitbake-build
54+
with:
55+
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}
56+
bitbake_machine: ${{ matrix.machine }}
57+
bitbake_source: 'poky-wayland layers.raspberrypi conf.wpe-${{ matrix.wpe_vers }} --update-config'
58+
repo_release: ${{ matrix.yocto_rel }}
59+
60+
matrix-build-image-freescale:
1461
strategy:
1562
fail-fast: false
1663
matrix:
17-
machine: ['raspberrypi3-mesa', 'raspberrypi4-64-mesa', 'raspberrypi5', 'wandboard-mesa']
64+
machine: ['wandboard-mesa']
1865
wpe_vers: ['2_46', 'nightly']
1966
yocto_rel: ['scarthgap']
2067
continue-on-error: true
2168
runs-on: [self-hosted, builder]
2269
if: "!contains(github.event.head_commit.message, 'ci skip')"
2370
needs: scarthgap-repo
2471
steps:
25-
#- uses: actions/checkout@v3
2672
- uses: ./.github/actions/bitbake-build
2773
with:
28-
bitbake_source: 'raspberrypi3-mesa-wpe-${{ matrix.wpe_vers }} ${{ matrix.machine }} poky-wayland layers.raspberrypi conf.wpe-${{ matrix.wpe_vers }} --update-config'
74+
bitbake_buildname: wpe-${{ matrix.wpe_vers }}-${{ matrix.machine }}
75+
bitbake_machine: ${{ matrix.machine }}
76+
bitbake_source: 'poky-wayland layers.freescale conf.wpe-${{ matrix.wpe_vers }} --update-config'
2977
repo_release: ${{ matrix.yocto_rel }}
3078

31-
# scarthgap-raspberrypi3-mesa-weston-wpe-nightly:
32-
# runs-on: self-hosted
33-
# if: "!contains(github.event.head_commit.message, 'ci skip')"
34-
# steps:
35-
# - uses: ./.github/actions/bitbake-build
36-
# with:
37-
# bitbake_source: 'rpi3-mesa-wpe-nightly raspberrypi3-mesa poky-wayland layers.raspberrypi conf.wpe-nightly --update-config'
38-
# repo_release: 'scarthgap'
39-
# needs: scarthgap-repo
40-
#
41-
# scarthgap-raspberrypi4-64-mesa-weston-wpe-nightly:
42-
# runs-on: self-hosted
43-
# if: "!contains(github.event.head_commit.message, 'ci skip')"
44-
# steps:
45-
# - uses: ./.github/actions/bitbake-build
46-
# with:
47-
# bitbake_source: 'rpi4-mesa-wpe-nightly raspberrypi4-64-mesa poky-wayland layers.raspberrypi conf.wpe-nightly --update-config'
48-
# repo_release: 'scarthgap'
49-
# needs: scarthgap-repo
50-
#
51-
# scarthgap-raspberrypi3-mesa-weston-wpe-2_38:
52-
# runs-on: self-hosted
53-
# if: "!contains(github.event.head_commit.message, 'ci skip')"
54-
# steps:
55-
# - uses: ./.github/actions/bitbake-build
56-
# with:
57-
# bitbake_source: 'rpi3-mesa-wpe-2_38 raspberrypi3-mesa poky-wayland layers.raspberrypi conf.wpe-2_38 --update-config'
58-
# repo_release: 'scarthgap'
59-
# needs: scarthgap-repo
60-
#
61-
# scarthgap-raspberrypi4-64-mesa-weston-wpe-2_38:
62-
# runs-on: self-hosted
63-
# if: "!contains(github.event.head_commit.message, 'ci skip')"
64-
# steps:
65-
# - uses: ./.github/actions/bitbake-build
66-
# with:
67-
# bitbake_source: 'rpi4-mesa-wpe-2_38 raspberrypi4-64-mesa poky-wayland layers.raspberrypi conf.wpe-2_38 --update-config'
68-
# repo_release: 'scarthgap'
69-
# needs: scarthgap-repo

0 commit comments

Comments
 (0)