Pin CLN mirror during conversion #4
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: tmt@TF | |
on: | |
issue_comment: | |
types: | |
- created | |
jobs: | |
pr_commented: | |
# This job only runs for '/rerun' pull request comments by owner, member, or collaborator of the repo/organization. | |
name: Run tmt tests on Testing Farm service | |
if: | | |
github.event.issue.pull_request | |
&& startsWith(github.event.comment.body, '/rerun') | |
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Get pull request number | |
id: pr_nr | |
run: | | |
PR_URL="${{ github.event.comment.issue_url }}" | |
echo "::set-output name=pr_nr::${PR_URL##*/}" | |
- name: Checkout | |
# TODO: The correct way to checkout would be to use simmilar approach as in get_commit_by_timestamp function of | |
# the github gluetool module (i.e. do not use HEAD but the last commit before comment). | |
id: checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: "refs/pull/${{ steps.pr_nr.outputs.pr_nr }}/head" | |
- name: Get ref and sha | |
id: ref_sha | |
run: | | |
echo "::set-output name=sha::$(git rev-parse --short HEAD)" | |
echo "::set-output name=ref::refs/pull/${{ steps.pr_nr.outputs.pr_nr }}/head" | |
- name: Trigger copr build | |
id: copr_build | |
run: | | |
cat << EOF > copr_fedora.conf | |
[copr-cli] | |
login = ${{ secrets.FEDORA_COPR_LOGIN }} | |
username = @oamg | |
token = ${{ secrets.FEDORA_COPR_TOKEN }} | |
copr_url = https://copr.fedorainfracloud.org | |
# expiration date: 2030-07-04 | |
EOF | |
pip install copr-cli | |
PR=${{ steps.pr_nr.outputs.pr_nr }} COPR_CONFIG=copr_fedora.conf make copr_build | tee copr.log | |
COPR_URL=$(grep -Po 'https://copr.fedorainfracloud.org/coprs/build/\d+' copr.log) | |
echo "::set-output name=copr_url::${COPR_URL}" | |
echo "::set-output name=copr_id::${COPR_URL##*/}" | |
- name: Add comment with copr build url | |
# TODO: Create comment when copr build fails. | |
id: link_copr | |
uses: actions/github-script@v4 | |
with: | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Copr build succeeded: ${{ steps.copr_build.outputs.copr_url }}' | |
}) | |
- name: Get dependent leapp pr number from rerun comment | |
uses: actions-ecosystem/action-regex-match@v2 | |
id: leapp_pr_regex_match | |
with: | |
text: ${{ github.event.comment.body }} | |
regex: '^/rerun\s+([0-9]+)\s*$' | |
- name: If leapp_pr was specified in the comment - trigger copr build | |
# TODO: XXX FIXME This should schedule copr build for leapp but for now it will be just setting an env var | |
id: leapp_pr | |
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }} | |
run: | | |
echo "::set-output name=leapp_pr::${{ steps.leapp_pr_regex_match.outputs.group1 }}" | |
- name: Checkout leapp | |
id: checkout_leapp | |
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }} | |
uses: actions/checkout@v2 | |
with: | |
repository: "oamg/leapp" | |
ref: "refs/pull/${{ steps.leapp_pr.outputs.leapp_pr }}/head" | |
- name: Get ref and sha for leapp | |
id: ref_sha_leapp | |
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }} | |
run: | | |
echo "::set-output name=sha::$(git rev-parse --short HEAD)" | |
echo "::set-output name=ref::refs/pull/${{ steps.leapp_pr.outputs.leapp_pr }}/head" | |
- name: Trigger copr build for leapp | |
id: copr_build_leapp | |
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }} | |
run: | | |
cat << EOF > copr_fedora.conf | |
[copr-cli] | |
login = ${{ secrets.FEDORA_COPR_LOGIN }} | |
username = @oamg | |
token = ${{ secrets.FEDORA_COPR_TOKEN }} | |
copr_url = https://copr.fedorainfracloud.org | |
# expiration date: 2030-07-04 | |
EOF | |
pip install copr-cli | |
PR=${{ steps.leapp_pr.outputs.leapp_pr }} COPR_CONFIG=copr_fedora.conf make copr_build | tee copr.log | |
COPR_URL=$(grep -Po 'https://copr.fedorainfracloud.org/coprs/build/\d+' copr.log) | |
echo "::set-output name=copr_url::${COPR_URL}" | |
echo "::set-output name=copr_id::${COPR_URL##*/}" | |
- name: Add comment with copr build url for leapp | |
# TODO: Create comment when copr build fails. | |
id: link_copr_leapp | |
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }} | |
uses: actions/github-script@v4 | |
with: | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Copr build succeeded: ${{ steps.copr_build_leapp.outputs.copr_url }}' | |
}) | |
- name: Schedule regression testing for 7to8 | |
id: run_test_7to8 | |
env: | |
ARTIFACTS: ${{ steps.leapp_pr_regex_match.outputs.match != '' && format('{0},{1}', steps.copr_build_leapp.outputs.copr_id, steps.copr_build.outputs.copr_id) || steps.copr_build.outputs.copr_id }} | |
uses: oamg/testing-farm-service-action@main | |
with: | |
# required | |
tft_server: ${{ secrets.TF_ENDPOINT }} | |
tft_token: ${{ secrets.TF_API_KEY }} | |
compose: ${{ secrets.COMPOSE_RHEL79 }} | |
artifacts: ${{ env.ARTIFACTS }} | |
# optional | |
tests_regex: "^(?!.*c2r)(?!.*sap)(?!.*8to9)" | |
arch: 'x86_64' | |
copr: 'epel-7-x86_64' | |
debug: ${{ secrets.ACTIONS_STEP_DEBUG }} | |
test_name: '7to8' | |
tmt_context: 'distro=rhel-7' | |
- name: Schedule regression testing for 8to9 | |
id: run_test_8to9 | |
env: | |
ARTIFACTS: ${{ steps.leapp_pr_regex_match.outputs.match != '' && format('{0},{1}', steps.copr_build_leapp.outputs.copr_id, steps.copr_build.outputs.copr_id) || steps.copr_build.outputs.copr_id }} | |
uses: oamg/testing-farm-service-action@main | |
with: | |
# required | |
tft_server: ${{ secrets.TF_ENDPOINT }} | |
tft_token: ${{ secrets.TF_API_KEY }} | |
compose: ${{ secrets.COMPOSE_RHEL86 }} | |
artifacts: ${{ env.ARTIFACTS }} | |
# optional | |
tests_regex: "^(?!.*c2r)(?!.*sap)(?!.*7to8)" | |
arch: 'x86_64' | |
copr: 'epel-8-x86_64' | |
debug: ${{ secrets.ACTIONS_STEP_DEBUG }} | |
test_name: '8to9' | |
env_vars: 'TARGET_RELEASE=9.0;TARGET_KERNEL=el9;RHSM_SKU=RH00069;RHSM_REPOS=rhel-8-for-x86_64-appstream-beta-rpms,rhel-8-for-x86_64-baseos-beta-rpms;LEAPP_EXEC_ENV_VARS=LEAPP_DEVEL_TARGET_PRODUCT_TYPE=beta' | |
tmt_context: 'distro=rhel-8' |