Skip to content

Commit

Permalink
ci: add fedora 42 (Rawhide) support
Browse files Browse the repository at this point in the history
  • Loading branch information
mcattamoredhat committed Sep 20, 2024
1 parent f2825b7 commit 8231015
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 75 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/fedora-41.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: Run Edge Test on Fedora 41

on:
issue_comment:
types:
- created

jobs:
pr-info:
if: ${{ github.event.issue.pull_request &&
(endsWith(github.event.comment.body, '/test-f41')) }}
runs-on: ubuntu-latest
steps:
- name: Query author repository permissions
uses: octokit/[email protected]
id: user_permission
with:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if user does have correct permissions
if: contains('admin write', fromJson(steps.user_permission.outputs.data).permission)
id: check_user_perm
run: |
echo "User '${{ github.event.sender.login }}' has permission '${{ fromJson(steps.user_permission.outputs.data).permission }}' allowed values: 'admin', 'write'"
echo "allowed_user=true" >> $GITHUB_OUTPUT
- name: Get information for pull request
uses: octokit/[email protected]
id: pr-api
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

outputs:
allowed_user: ${{ steps.check_user_perm.outputs.allowed_user }}
sha: ${{ fromJson(steps.pr-api.outputs.data).head.sha }}
ref: ${{ fromJson(steps.pr-api.outputs.data).head.ref }}
repo_url: ${{ fromJson(steps.pr-api.outputs.data).head.repo.html_url }}

iot-f41-x86:
needs: pr-info
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request }}
continue-on-error: true
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ needs.pr-info.outputs.sha }}
fetch-depth: 0

- name: Run the tests
uses: sclorg/[email protected]
with:
compose: Fedora-41
api_key: ${{ secrets.TF_API_KEY }}
git_url: ${{ needs.pr-info.outputs.repo_url }}
git_ref: ${{ needs.pr-info.outputs.ref }}
update_pull_request_status: true
pull_request_status_name: "iot-f41-x86"
tmt_context: "arch=x86_64;distro=fedora"
tmt_plan_regex: edge-x86
tf_scope: private
secrets: "DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }};DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }};AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }};AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }};GOVC_URL=${{ secrets.GOVC_URL }};GOVC_USERNAME=${{ secrets.GOVC_USERNAME }};GOVC_PASSWORD=${{ secrets.GOVC_PASSWORD }}"
variables: "ARCH=x86_64;AWS_DEFAULT_REGION=us-east-1;GOVC_INSECURE=1"

iot-f41-arm:
needs: pr-info
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request }}
continue-on-error: true
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ needs.pr-info.outputs.sha }}
fetch-depth: 0

- name: Run the tests
uses: sclorg/[email protected]
with:
compose: Fedora-41
api_key: ${{ secrets.TF_API_KEY }}
git_url: ${{ needs.pr-info.outputs.repo_url }}
git_ref: ${{ needs.pr-info.outputs.ref }}
update_pull_request_status: true
pull_request_status_name: "iot-f41-arm"
tmt_context: "arch=aarch64;distro=fedora"
tmt_plan_regex: edge-arm
tf_scope: private
secrets: "DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }};DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }};AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }};AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }};GOVC_URL=${{ secrets.GOVC_URL }};GOVC_USERNAME=${{ secrets.GOVC_USERNAME }};GOVC_PASSWORD=${{ secrets.GOVC_PASSWORD }}"
variables: "ARCH=aarch64;AWS_DEFAULT_REGION=us-east-1;GOVC_INSECURE=1"
180 changes: 126 additions & 54 deletions .github/workflows/trigger-fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ on:

env:
COMPOSE_URL_rawhide: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide
COMPOSE_URL_F41: https://dl.fedoraproject.org/pub/fedora/linux/development/41
UPDATES_URL_F41: https://dl.fedoraproject.org/pub/fedora/linux/development/41
COMPOSE_URL_F40: https://dl.fedoraproject.org/pub/fedora/linux/releases/40
UPDATES_URL_F40: https://dl.fedoraproject.org/pub/fedora/linux/releases/40
COMPOSE_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/releases/39
UPDATES_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/updates/39
UPDATES_URL_F40: https://dl.fedoraproject.org/pub/fedora/linux/updates/40
# COMPOSE_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/releases/39
# UPDATES_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/updates/39

jobs:

Expand Down Expand Up @@ -128,7 +130,7 @@ jobs:
column-name: Fedora-rawhide
issue-number: ${{ steps.cpr.outputs.pull-request-number }}

fedora-40:
fedora-41:
# Do not need check-compose and make "workflow_dispatch" work for this job
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 4 * * *'
runs-on: ubuntu-latest
Expand All @@ -138,23 +140,23 @@ jobs:
- name: Get package version
id: package_version
run: |
curl -s "${COMPOSE_URL_F40}/COMPOSE_ID" --output COMPOSE_ID_F40
COMPOSE_ID_F40=$(cat COMPOSE_ID_F40)
curl -s "${COMPOSE_URL_F41}/COMPOSE_ID" --output COMPOSE_ID_F41
COMPOSE_ID_F41=$(cat COMPOSE_ID_F41)
OSBUILD_VERSION_F40=$(curl -s "${UPDATES_URL_F40}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F40=$(curl -s "${UPDATES_URL_F40}/Everything/os/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F40=$(curl -s "${COMPOSE_URL_F40}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f40=$OSBUILD_VERSION_F40" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f40=$OSBUILD_COMPOSER_VERSION_F40" >> $GITHUB_OUTPUT
echo "composer_cli_version_f40=$COMPOSER_CLI_VERSION_F40" >> $GITHUB_OUTPUT
OSBUILD_VERSION_F41=$(curl -s "${UPDATES_URL_F41}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F41=$(curl -s "${UPDATES_URL_F41}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F41=$(curl -s "${COMPOSE_URL_F41}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f41=$OSBUILD_VERSION_F41" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f41=$OSBUILD_COMPOSER_VERSION_F41" >> $GITHUB_OUTPUT
echo "composer_cli_version_f41=$COMPOSER_CLI_VERSION_F41" >> $GITHUB_OUTPUT
echo "f40_compose=$COMPOSE_ID_F40" >> $GITHUB_OUTPUT
echo "f41_compose=$COMPOSE_ID_F41" >> $GITHUB_OUTPUT
- name: Add new compose id in compose.f40
- name: Add new compose id in compose.f41
run: |
compose_id="${{ steps.package_version.outputs.f40_compose }}"
echo $compose_id >> compose/compose.f40
cat compose/compose.f40
compose_id="${{ steps.package_version.outputs.f41_compose }}"
echo $compose_id >> compose/compose.f41
cat compose/compose.f41
- name: Get current date
id: date
Expand All @@ -165,66 +167,66 @@ jobs:
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fedora 40 Daily Compose Test - ${{ steps.date.outputs.date }}"
commit-message: "Fedora 41 Daily Compose Test - ${{ 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: " Fedora 40 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-40
title: " Fedora 41 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-41
body: |
Fedora 40 compose ${{ steps.package_version.outputs.f40_compose }}
Fedora 41 compose ${{ steps.package_version.outputs.f41_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_F40 }}
- Updates URL: ${{ env.UPDATES_URL_F40 }}
- Compose URL: ${{ env.COMPOSE_URL_F41 }}
- Updates URL: ${{ env.UPDATES_URL_F41 }}
- Packages:
- ${{ steps.package_version.outputs.osbuild_version_f40 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f40 }}
- ${{ steps.package_version.outputs.composer_cli_version_f40 }}
- ${{ steps.package_version.outputs.osbuild_version_f41 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f41 }}
- ${{ steps.package_version.outputs.composer_cli_version_f41 }}
- 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: /test-f40
body: /test-f41

- 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: Fedora Compose Test
column-name: Fedora-40
column-name: Fedora-41
issue-number: ${{ steps.cpr.outputs.pull-request-number }}

fedora-39:
fedora-40:
# Do not need check-compose and make "workflow_dispatch" work for this job
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 16 * * *'
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 4 * * *'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Get package version
id: package_version
run: |
curl -s "${COMPOSE_URL_F39}/COMPOSE_ID" --output COMPOSE_ID_F39
COMPOSE_ID_F39=$(cat COMPOSE_ID_F39)
curl -s "${COMPOSE_URL_F40}/COMPOSE_ID" --output COMPOSE_ID_F40
COMPOSE_ID_F40=$(cat COMPOSE_ID_F40)
OSBUILD_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F39=$(curl -s "${COMPOSE_URL_F39}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f39=$OSBUILD_VERSION_F39" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f39=$OSBUILD_COMPOSER_VERSION_F39" >> $GITHUB_OUTPUT
echo "composer_cli_version_f39=$COMPOSER_CLI_VERSION_F39" >> $GITHUB_OUTPUT
OSBUILD_VERSION_F40=$(curl -s "${UPDATES_URL_F40}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F40=$(curl -s "${UPDATES_URL_F40}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F40=$(curl -s "${COMPOSE_URL_F40}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f40=$OSBUILD_VERSION_F40" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f40=$OSBUILD_COMPOSER_VERSION_F40" >> $GITHUB_OUTPUT
echo "composer_cli_version_f40=$COMPOSER_CLI_VERSION_F40" >> $GITHUB_OUTPUT
echo "f39_compose=$COMPOSE_ID_F39" >> $GITHUB_OUTPUT
echo "f40_compose=$COMPOSE_ID_F40" >> $GITHUB_OUTPUT
- name: Add new compose id in compose.f39
- name: Add new compose id in compose.f40
run: |
compose_id="${{ steps.package_version.outputs.f39_compose }}"
echo $compose_id >> compose/compose.f39
cat compose/compose.f39
compose_id="${{ steps.package_version.outputs.f40_compose }}"
echo $compose_id >> compose/compose.f40
cat compose/compose.f40
- name: Get current date
id: date
Expand All @@ -235,35 +237,105 @@ jobs:
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fedora 39 Daily Compose Test - ${{ steps.date.outputs.date }}"
commit-message: "Fedora 40 Daily Compose Test - ${{ 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: " Fedora 39 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-39
title: " Fedora 40 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-40
body: |
Fedora 39 compose ${{ steps.package_version.outputs.f39_compose }}
Fedora 40 compose ${{ steps.package_version.outputs.f40_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_F39 }}
- Updates URL: ${{ env.UPDATES_URL_F39 }}
- Compose URL: ${{ env.COMPOSE_URL_F40 }}
- Updates URL: ${{ env.UPDATES_URL_F40 }}
- Packages:
- ${{ steps.package_version.outputs.osbuild_version_f39 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f39 }}
- ${{ steps.package_version.outputs.composer_cli_version_f39 }}
- ${{ steps.package_version.outputs.osbuild_version_f40 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f40 }}
- ${{ steps.package_version.outputs.composer_cli_version_f40 }}
- 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: /test-f39
body: /test-f40

- 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: Fedora Compose Test
column-name: Fedora-39
column-name: Fedora-40
issue-number: ${{ steps.cpr.outputs.pull-request-number }}

# fedora-39:
# # Do not need check-compose and make "workflow_dispatch" work for this job
# if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 16 * * *'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
#
# - name: Get package version
# id: package_version
# run: |
# curl -s "${COMPOSE_URL_F39}/COMPOSE_ID" --output COMPOSE_ID_F39
# COMPOSE_ID_F39=$(cat COMPOSE_ID_F39)
#
# OSBUILD_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
# OSBUILD_COMPOSER_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
# COMPOSER_CLI_VERSION_F39=$(curl -s "${COMPOSE_URL_F39}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
# echo "osbuild_version_f39=$OSBUILD_VERSION_F39" >> $GITHUB_OUTPUT
# echo "osbuild_composer_version_f39=$OSBUILD_COMPOSER_VERSION_F39" >> $GITHUB_OUTPUT
# echo "composer_cli_version_f39=$COMPOSER_CLI_VERSION_F39" >> $GITHUB_OUTPUT
#
# echo "f39_compose=$COMPOSE_ID_F39" >> $GITHUB_OUTPUT
#
# - name: Add new compose id in compose.f39
# run: |
# compose_id="${{ steps.package_version.outputs.f39_compose }}"
# echo $compose_id >> compose/compose.f39
# cat compose/compose.f39
#
# - 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: "Fedora 39 Daily Compose Test - ${{ 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: " Fedora 39 Daily Compose Test- ${{ steps.date.outputs.date }}"
# labels: DO_NOT_MERGE,fedora-39
# body: |
# Fedora 39 compose ${{ steps.package_version.outputs.f39_compose }}
# - Date: ${{ steps.date.outputs.date }}
# - Compose URL: ${{ env.COMPOSE_URL_F39 }}
# - Updates URL: ${{ env.UPDATES_URL_F39 }}
# - Packages:
# - ${{ steps.package_version.outputs.osbuild_version_f39 }}
# - ${{ steps.package_version.outputs.osbuild_composer_version_f39 }}
# - ${{ steps.package_version.outputs.composer_cli_version_f39 }}
#
# - 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: /test-f39
#
# - 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: Fedora Compose Test
# column-name: Fedora-39
# issue-number: ${{ steps.cpr.outputs.pull-request-number }}
Loading

0 comments on commit 8231015

Please sign in to comment.