Weekly images update #11
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: Weekly images update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 2 * * 0' | |
jobs: | |
update-image: | |
name: ${{ matrix.group }} | |
runs-on: [self-hosted, spread-enabled] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- group: ubuntu 14.04 (google) | |
task: ubuntu-14.04-64 | |
source: ubuntu-14.04-64 | |
target: ubuntu-14.04-64 | |
cloud: google | |
- group: ubuntu 16.04 (google) | |
task: ubuntu-16.04-64 | |
source: ubuntu-16.04-64 | |
target: ubuntu-16.04-64 | |
cloud: google | |
- group: ubuntu 18.04 (google) | |
task: ubuntu-18.04-64 | |
source: ubuntu-18.04-64 | |
target: ubuntu-18.04-64 | |
cloud: google | |
- group: ubuntu 20.04 (google) | |
task: ubuntu-20.04-64 | |
source: ubuntu-20.04-64-base | |
target: ubuntu-20.04-64 | |
cloud: google | |
- group: ubuntu 22.04 (google) | |
task: ubuntu-22.04-64 | |
source: ubuntu-22.04-64-base | |
target: ubuntu-22.04-64 | |
cloud: google | |
- group: ubuntu 24.04 (google) | |
task: ubuntu-24.04-64 | |
source: ubuntu-24.04-64-base | |
target: ubuntu-24.04-64 | |
cloud: google | |
- group: ubuntu 24.10 (google) | |
task: ubuntu-24.10-64 | |
source: ubuntu-24.10-64-base | |
target: ubuntu-24.10-64 | |
cloud: google | |
- group: debian 11 (google) | |
task: debian-11 | |
source: debian-11-64-base | |
target: debian-11-64 | |
cloud: google | |
- group: debian 12 (google) | |
task: debian-12 | |
source: debian-12-64-base | |
target: debian-12-64 | |
cloud: google | |
- group: debian sid (google) | |
task: debian-sid | |
source: debian-sid-64-base | |
target: debian-sid-64 | |
cloud: google | |
- group: amazon linux 2 (google) | |
task: amazon-linux-2 | |
source: amazon-linux-2-64-base | |
target: amazon-linux-2-64 | |
cloud: google | |
- group: amazon linux 2023 (google) | |
task: amazon-linux-2023 | |
source: amazon-linux-2023-64-base | |
target: amazon-linux-2023-64 | |
cloud: google | |
- group: centos 9 (google) | |
task: centos-9 | |
source: centos-9-64-base | |
target: centos-9-64 | |
cloud: google | |
- group: opensuse 15.5 (google) | |
task: opensuse-15-5 | |
source: opensuse-15.5-64-base | |
target: opensuse-15.5-64 | |
cloud: google | |
- group: opensuse 15.6 (google) | |
task: opensuse-15-6 | |
source: opensuse-15.6-64-base | |
target: opensuse-15.6-64 | |
cloud: google | |
- group: opensuse tumbleweed (google) | |
task: opensuse-tumbleweed | |
source: opensuse-tumbleweed-64-base | |
target: opensuse-tumbleweed-64 | |
cloud: google | |
- group: arch linux (google) | |
task: arch-linux | |
source: arch-linux-64-base | |
target: arch-linux-64 | |
cloud: google | |
- group: fedora 39 (google) | |
task: fedora-39-64 | |
source: fedora-39-64-base | |
target: fedora-39-64 | |
cloud: google | |
steps: | |
- name: Ensure the workspace is clean | |
run: | | |
rm -rf "${{ github.workspace }}" | |
mkdir "${{ github.workspace }}" | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Run test | |
env: | |
IMAGE_BAKER_SA: ${{ secrets.IMAGE_BAKER_SA }} | |
run: | | |
if [ "${{ matrix.cloud }}" == google ]; then | |
echo "$IMAGE_BAKER_SA" > sa.json | |
if ! spread "${{ matrix.cloud }}:${{ matrix.source }}:tasks/${{ matrix.cloud }}/update-image/${{ matrix.task }}"; then | |
echo "Spread images task failed, exiting..." | |
exit 1 | |
fi | |
spread "${{ matrix.cloud }}:${{ matrix.target }}:tasks/${{ matrix.cloud }}/common/clean-old-images" | |
elif [ "${{ matrix.cloud }}" == openstack ]; then | |
echo "Openstack updates not supported yet, exiting..." | |
exit 1 | |
else | |
echo "${{ matrix.cloud }} updates not supported, exiting..." | |
exit 1 | |
fi | |
- name: Discard spread workers | |
if: always() | |
run: | | |
shopt -s nullglob; | |
for r in .spread-reuse.*.yaml; do | |
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')"; | |
done | |
- name: Cleanup job workspace after run tests | |
if: always() | |
run: | | |
rm -rf "${{ github.workspace }}" | |
mkdir "${{ github.workspace }}" |