-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (94 loc) · 5.13 KB
/
trigger-cs-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
name: centos-bootc-dev:stream9 trigger
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
check-image:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/bootc-workflow-report'
runs-on: ubuntu-latest
steps:
- name: Check centos-bootc-dev:stream9 image info
id: check_image_cs9
run: |
IMAGE_DIGEST=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc-dev:stream9 | jq -r '.Digest')
IMAGE_VERSION=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc-dev:stream9 | jq -r '.Labels.version')
KERNEL_VERSION=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc-dev:stream9 | jq -r '.Labels."ostree.linux"')
COMPOSE_ID=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc-dev:stream9 | jq -r '.Labels."redhat.compose-id"')
BOOTC_VERSION=$(podman run --rm quay.io/centos-bootc/centos-bootc-dev:stream9 rpm -qa | grep bootc)
OSTREE_VERSION=$(podman run --rm quay.io/centos-bootc/centos-bootc-dev:stream9 rpm -qa | grep "^ostree-2")
BOOTUPD_VERSION=$(podman run --rm quay.io/centos-bootc/centos-bootc-dev:stream9 rpm -qa | grep bootupd)
echo "image_digest=$IMAGE_DIGEST" >> $GITHUB_OUTPUT
echo "image_version=$IMAGE_VERSION" >> $GITHUB_OUTPUT
echo "kernel_version=$KERNEL_VERSION" >> $GITHUB_OUTPUT
echo "compose_id=$COMPOSE_ID" >> $GITHUB_OUTPUT
echo "bootc_version=$BOOTC_VERSION" >> $GITHUB_OUTPUT
echo "ostree_version=$OSTREE_VERSION" >> $GITHUB_OUTPUT
echo "bootupd_version=$BOOTUPD_VERSION" >> $GITHUB_OUTPUT
outputs:
image_digest: ${{ steps.check_image_cs9.outputs.image_digest }}
image_version: ${{ steps.check_image_cs9.outputs.image_version }}
kernel_version: ${{ steps.check_image_cs9.outputs.kernel_version }}
compose_id: ${{ steps.check_image_cs9.outputs.compose_id }}
bootc_version: ${{ steps.check_image_rhel9.outputs.bootc_version }}
ostree_version: ${{ steps.check_image_rhel9.outputs.ostree_version }}
bootupd_version: ${{ steps.check_image_rhel9.outputs.bootupd_version }}
create-pr:
needs: check-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Save tested container image digest
run: echo "${{ needs.check-image.outputs.image_digest }}" >> pr_files/pr_file.cs-dev
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "build: centos-bootc-dev:stream9 - ${{ needs.check-image.outputs.image_version }} - ${{ steps.date.outputs.date }}"
committer: cloudkitebot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: cpr
branch-suffix: random
delete-branch: true
title: "centos-bootc-dev:stream9 - ${{ needs.check-image.outputs.image_version }} - ${{ steps.date.outputs.date }}"
labels: auto-merge,centos-bootc-dev:stream9
body: |
centos-bootc-dev:stream9 image ${{ needs.check-image.outputs.image_version }}
- Date: ${{ steps.date.outputs.date }}
- Image URL: quay.io/centos-bootc/centos-bootc-dev:stream9
- Image Digest: ${{ needs.check-image.outputs.image_digest }}
- Image Version: ${{ needs.check-image.outputs.image_version }}
- Kernel Version: ${{ needs.check-image.outputs.kernel_version }}
- Compose ID: ${{ needs.check-image.outputs.compose_id }}
- bootc Version: ${{ needs.check-image.outputs.bootc_version }}
- ostree Version: ${{ needs.check-image.outputs.ostree_version }}
- bootupd Version: ${{ needs.check-image.outputs.bootupd_version }}
Test includes OS replace test and anaconda installation test
- The OS replace test will use `bootc install` command inside bootc container image to install bootc OCI Image
- The anaconda test will install the bootc OCI image from kickstart command `ostreecontainer`
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: rebase
- name: Add a comment to trigger test workflow
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body: /test-cs9-dev
- name: Create a project card to track compose test result
uses: peter-evans/create-or-update-project-card@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
project-name: bootc test
column-name: centos-bootc-dev:stream9
issue-number: ${{ steps.cpr.outputs.pull-request-number }}