ARM64 Edge test trigger #88
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: ARM64 Edge test trigger | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3 * * 1,3,5' | |
env: | |
COMPOSE_URL_CS9: https://composes.stream.centos.org/production | |
jobs: | |
check-compose: | |
# Do not run this job on any fork repos | |
if: github.repository == 'virt-s1/rhel-edge' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check CentOS Stream 9 compose | |
id: check_compose_id_cs9 | |
run: | | |
CURRENT_COMPOSE_CS9=$(curl -s "${COMPOSE_URL_CS9}/" | grep -ioE ">CentOS-Stream-9-.*/<" | tr -d '>/<' | tail -1) | |
curl -s ${COMPOSE_URL_CS9}/${CURRENT_COMPOSE_CS9}/STATUS --output STATUS_CS9 | |
STATUS_CS9=$(cat STATUS_CS9) | |
if [[ "$STATUS_CS9" == "FINISHED" ]]; then | |
COMPOSE_ID_CS9=$CURRENT_COMPOSE_CS9 | |
else | |
COMPOSE_ID_CS9="false" | |
fi | |
if [[ "$COMPOSE_ID_CS9" != "false" ]]; then | |
OSBUILD_VERSION_CS9=$(curl -s "${COMPOSE_URL_CS9}/${COMPOSE_ID_CS9}/compose/AppStream/aarch64/os/Packages/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><") | |
OSBUILD_COMPOSER_VERSION_CS9=$(curl -s "${COMPOSE_URL_CS9}/${COMPOSE_ID_CS9}/compose/AppStream/aarch64/os/Packages/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><") | |
COMPOSER_CLI_VERSION_CS9=$(curl -s "${COMPOSE_URL_CS9}/${COMPOSE_ID_CS9}/compose/AppStream/aarch64/os/Packages/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><") | |
echo "osbuild_version_cs9=$OSBUILD_VERSION_CS9" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_cs9=$OSBUILD_COMPOSER_VERSION_CS9" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_cs9=$COMPOSER_CLI_VERSION_CS9" >> $GITHUB_OUTPUT | |
else | |
echo "osbuild_version_cs9=Null" >> $GITHUB_OUTPUT | |
echo "osbuild_composer_version_cs9=Null" >> $GITHUB_OUTPUT | |
echo "composer_cli_version_cs9=Null" >> $GITHUB_OUTPUT | |
fi | |
echo "cs9_compose=$COMPOSE_ID_CS9" >> $GITHUB_OUTPUT | |
outputs: | |
cs9_compose: ${{ steps.check_compose_id_cs9.outputs.cs9_compose }} | |
osbuild_version_cs9: ${{ steps.check_compose_id_cs9.outputs.osbuild_version_cs9 }} | |
osbuild_composer_version_cs9: ${{ steps.check_compose_id_cs9.outputs.osbuild_composer_version_cs9 }} | |
composer_cli_version_cs9: ${{ steps.check_compose_id_cs9.outputs.composer_cli_version_cs9 }} | |
arm-cs9: | |
needs: check-compose | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Make change for PR creating | |
run: | | |
compose_id="${{ needs.check-compose.outputs.cs9_compose }}" | |
echo $compose_id >> arm_cs9.run | |
- 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@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "aarch64 - ${{ needs.check-compose.outputs.cs9_compose }} - ${{ 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: "[aarch64] ${{ needs.check-compose.outputs.cs9_compose }} - ${{ steps.date.outputs.date }}" | |
labels: DO_NOT_MERGE,CentOS-Stream-9,aarch64 | |
body: | | |
CentOS Stream 9 compose ${{ needs.check-compose.outputs.cs9_compose }} | |
- Date: ${{ steps.date.outputs.date }} | |
- Compose URL: "${{ env.COMPOSE_URL_CS9 }}/${{ needs.check-compose.outputs.cs9_compose }}" | |
- Packages: | |
- ${{ needs.check-compose.outputs.osbuild_version_cs9 }} | |
- ${{ needs.check-compose.outputs.osbuild_composer_version_cs9 }} | |
- ${{ needs.check-compose.outputs.composer_cli_version_cs9 }} | |
- name: Add a comment to trigger test workflow | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} | |
body: /arm-cs9-all | |
- name: Create a project card to track compose test result | |
uses: peter-evans/create-or-update-project-card@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
project-name: RHEL Compose Test | |
column-name: CentOS-Stream-9 | |
issue-number: ${{ steps.cpr.outputs.pull-request-number }} |