Create test-ci-main-branh #38
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: Run Edge Test on RHEL 9.0.0 | |
on: | |
issue_comment: | |
types: | |
- created | |
jobs: | |
pr-info: | |
if: ${{ github.event.issue.pull_request && | |
(endsWith(github.event.comment.body, '/test-rhel-9-0') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-virt') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-ng') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-raw') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-simplified') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-8to9')) }} | |
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 }} | |
# restrict running of tests to users with admin or write permission for the repository | |
# see https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-repository-permissions-for-a-user | |
- 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 "::set-output name=allowed_user::true" | |
- 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 }} | |
edge-commit-90: | |
needs: pr-info | |
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request && | |
(endsWith(github.event.comment.body, '/test-rhel-9-0') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-virt')) }} | |
runs-on: [kite, x86_64, rhos-01, rhel-9-0, large] | |
env: | |
STATUS_NAME: edge-commit-9.0 | |
steps: | |
- name: Create in-progress status | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: pending | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.pr-info.outputs.sha }} | |
fetch-depth: 0 | |
- name: Checkout rhel-edge repository | |
uses: actions/checkout@v3 | |
with: | |
repository: virt-s1/rhel-edge | |
path: rhel-edge | |
- name: run ostree.sh | |
run: ./ostree.sh | |
env: | |
DOWNLOAD_NODE: ${{ secrets.DOWNLOAD_NODE }} | |
working-directory: ./rhel-edge | |
- name: Set result status | |
if: always() | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: ${{ job.status }} | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
edge-installer-90: | |
needs: pr-info | |
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request && | |
(endsWith(github.event.comment.body, '/test-rhel-9-0') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-ng')) }} | |
runs-on: [kite, x86_64, rhos-01, rhel-9-0, large] | |
env: | |
STATUS_NAME: edge-installer-9.0 | |
steps: | |
- name: Create in-progress status | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: pending | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.pr-info.outputs.sha }} | |
fetch-depth: 0 | |
- name: Checkout rhel-edge repository | |
uses: actions/checkout@v3 | |
with: | |
repository: virt-s1/rhel-edge | |
path: rhel-edge | |
- name: run ostree-ng.sh | |
run: ./ostree-ng.sh | |
working-directory: ./rhel-edge | |
env: | |
OCP4_TOKEN: ${{ secrets.OCP4_TOKEN }} | |
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} | |
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} | |
DOWNLOAD_NODE: ${{ secrets.DOWNLOAD_NODE }} | |
- name: Set result status | |
if: always() | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: ${{ job.status }} | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
edge-raw-image-90: | |
needs: pr-info | |
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request && | |
(endsWith(github.event.comment.body, '/test-rhel-9-0') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-raw')) }} | |
runs-on: [kite, x86_64, rhos-01, rhel-9-0, large] | |
env: | |
STATUS_NAME: edge-raw-image-9.0 | |
steps: | |
- name: Create in-progress status | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: pending | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.pr-info.outputs.sha }} | |
fetch-depth: 0 | |
- name: Checkout rhel-edge repository | |
uses: actions/checkout@v3 | |
with: | |
repository: virt-s1/rhel-edge | |
path: rhel-edge | |
- name: run ostree-raw-image.sh | |
run: ./ostree-raw-image.sh | |
env: | |
DOWNLOAD_NODE: ${{ secrets.DOWNLOAD_NODE }} | |
working-directory: ./rhel-edge | |
- name: Set result status | |
if: always() | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: ${{ job.status }} | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
edge-simplified-90: | |
needs: pr-info | |
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request && | |
(endsWith(github.event.comment.body, '/test-rhel-9-0') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-simplified')) }} | |
runs-on: [kite, x86_64, rhos-01, rhel-9-0, large] | |
env: | |
STATUS_NAME: edge-simplified-installer-9.0 | |
steps: | |
- name: Create in-progress status | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: pending | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.pr-info.outputs.sha }} | |
fetch-depth: 0 | |
- name: Checkout rhel-edge repository | |
uses: actions/checkout@v3 | |
with: | |
repository: virt-s1/rhel-edge | |
path: rhel-edge | |
- name: run ostree-simplified-installer.sh | |
run: ./ostree-simplified-installer.sh | |
env: | |
DOWNLOAD_NODE: ${{ secrets.DOWNLOAD_NODE }} | |
working-directory: ./rhel-edge | |
- name: Set result status | |
if: always() | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: ${{ job.status }} | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
edge-8to9-90: | |
needs: pr-info | |
if: ${{ needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request && | |
(endsWith(github.event.comment.body, '/test-rhel-9-0') || | |
endsWith(github.event.comment.body, '/test-rhel-9-0-8to9')) }} | |
runs-on: [kite, x86_64, rhos-01, rhel-9-0, large] | |
env: | |
STATUS_NAME: edge-8to9-9.0 | |
steps: | |
- name: Create in-progress status | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: pending | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ needs.pr-info.outputs.sha }} | |
fetch-depth: 0 | |
- name: Checkout rhel-edge repository | |
uses: actions/checkout@v3 | |
with: | |
repository: virt-s1/rhel-edge | |
path: rhel-edge | |
- name: run ostree-8-to-9.sh | |
run: ./ostree-8-to-9.sh | |
env: | |
DOWNLOAD_NODE: ${{ secrets.DOWNLOAD_NODE }} | |
working-directory: ./rhel-edge | |
- name: Set result status | |
if: always() | |
uses: octokit/[email protected] | |
with: | |
route: 'POST /repos/${{ github.repository }}/statuses/${{ needs.pr-info.outputs.sha }}' | |
context: ${{ env.STATUS_NAME }} | |
state: ${{ job.status }} | |
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |