Skip to content

Commit

Permalink
ci: test repo dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi He committed Jul 23, 2024
1 parent a1c2408 commit fea84ad
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 55 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/rhel-95.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: RHEL for Edge test on RHEL 9

on:
# Triggered by osbuild-composer CI from gitlab
repository_dispatch:
types: [osbuild-composer-ci]
# on:
# repository_dispatch:
# types: [osbuild-composer-ci]

jobs:
pr-info:
Expand All @@ -28,17 +27,26 @@ jobs:
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 }}
sender_repo: ${{ fromJson(steps.pr-api.outputs.data).head.repo.full_name }}

edge-rhel-95:
needs: pr-info
runs-on: ubuntu-latest

steps:
- name: Run the tests
uses: sclorg/testing-farm-as-github-action@v2
uses: sclorg/testing-farm-as-github-action@main
with:
compose: RHEL-9.5.0-Nightly
arch: x86_64
debug: true
api_key: ${{ secrets.TF_API_KEY }}
git_url: ${{ needs.pr-info.outputs.repo_url }}
git_ref: ${{ needs.pr-info.outputs.ref }}
github_token: ${{ secrets.PAT }}
update_pull_request_status: true
tmt_context: "arch=x86_64;distro=rhel-9-5"
pull_request_status_name: "edge-rhel-9.5-x86"
tmt_plan_regex: edge-x86
tf_scope: private
secrets: "DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};V2_QUAY_USERNAME=${{ secrets.V2_QUAY_USERNAME }};V2_QUAY_PASSWORD=${{ secrets.V2_QUAY_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;CI=true;EDGE_USER_PASSWORD=foobar;GIT_COMMIT=${{ needs.pr-info.outputs.sha }}"

52 changes: 52 additions & 0 deletions .github/workflows/single.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: RHEL for Edge test on RHEL 9

on:
repository_dispatch:
types: [osbuild-composer-ci]

jobs:
pr-info:
runs-on: ubuntu-latest
steps:
- name: Get PR number from string PR-xxxx
id: pr-num
run: |
PR_NUM=$(echo "${{ github.event.client_payload.pr_number }}" | cut -d'-' -f 2)
echo "pr_number=$PR_NUM" >> $GITHUB_OUTPUT
- name: Get information for osbuild-composer pull request
uses: octokit/request-action@v2.x
id: pr-api
with:
route: GET /repos/osbuild/osbuild-composer/pulls/${{ steps.pr-num.outputs.pr_number }}
env:
GITHUB_TOKEN: ${{ secrets.PAT }}

outputs:
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 }}

edge-rhel-95:
needs: pr-info
runs-on: ubuntu-latest

steps:
- name: Run the tests
uses: sclorg/testing-farm-as-github-action@main
with:
compose: RHEL-9.5.0-Nightly
arch: x86_64
api_key: ${{ secrets.TF_API_KEY }}
git_url: ${{ needs.pr-info.outputs.repo_url }}
git_ref: ${{ needs.pr-info.outputs.ref }}
github_token: ${{ secrets.PAT }}
update_pull_request_status: true
tmt_context: "arch=x86_64;distro=rhel-9-5"
pull_request_status_name: "edge-rhel-9.5-x86"
tmt_plan_regex: edge-x86-simplified-installer
tf_scope: private
secrets: "DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};V2_QUAY_USERNAME=${{ secrets.V2_QUAY_USERNAME }};V2_QUAY_PASSWORD=${{ secrets.V2_QUAY_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;CI=true;EDGE_USER_PASSWORD=foobar;GIT_COMMIT=${{ needs.pr-info.outputs.sha }}"

9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: RHEL for Edge test on RHEL 9
name: Check PR information

on:
# Triggered by osbuild-composer CI from gitlab
repository_dispatch:
types: [osbuild-composer-ci]
# on:
# repository_dispatch:
# types: [osbuild-composer-ci]

jobs:
pr-info:
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/trigger-by-comment.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/trigger-by-gitlab.yml

This file was deleted.

0 comments on commit fea84ad

Please sign in to comment.