Skip to content

Commit 6e0c8bd

Browse files
committed
ci: Add tags to TF workflow, allow more [citest bad] formats
* Add "BusinessUnit": "system_roles" environment setting to tag our jobs in Testing farm * Add tmt_plan_filter to run additional workflows besides general * Allow more [citest bad] comment formats * Get memory and supported platforms info from the PR ref * Move LINUXSYSTEMROLES_USER to vars and use it everywhere in tft.yml * Remove extra GITHUB_ORG definition Signed-off-by: Sergei Petrosian <[email protected]>
1 parent 59a1581 commit 6e0c8bd

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.github/workflows/tft.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ jobs:
4848
PR_NO: ${{ github.event.issue.number }}
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050

51+
- name: Checkout PR
52+
uses: actions/checkout@v4
53+
with:
54+
ref: ${{ steps.head_sha.outputs.head_sha }}
55+
5156
- name: Get memory
5257
id: memory
5358
run: |
@@ -113,17 +118,17 @@ jobs:
113118
ARTIFACTS_DIR_NAME: "tf_${{ github.event.repository.name }}-${{ github.event.issue.number }}_\
114119
${{ matrix.platform }}-${{ matrix.ansible_version }}_\
115120
${{ needs.prepare_vars.outputs.datetime }}/artifacts"
116-
ARTIFACT_TARGET_DIR: /srv/pub/alt/linuxsystemroles/logs
121+
ARTIFACT_TARGET_DIR: /srv/pub/alt/${{ vars.LINUXSYSTEMROLES_USER }}/logs
117122
steps:
118123
- name: Set variables with DATETIME and artifact location
119124
id: set_vars
120125
run: |
121126
printf -v DATETIME '%(%Y%m%d-%H%M%S)T' -1
122127
ARTIFACTS_DIR_NAME="tf_${{ github.event.repository.name }}-${{ github.event.issue.number }}_\
123128
${{ matrix.platform }}-${{ matrix.ansible_version }}_$DATETIME/artifacts"
124-
ARTIFACTS_TARGET_DIR=/srv/pub/alt/linuxsystemroles/logs
129+
ARTIFACTS_TARGET_DIR=/srv/pub/alt/${{ vars.LINUXSYSTEMROLES_USER }}/logs
125130
ARTIFACTS_DIR=$ARTIFACTS_TARGET_DIR/$ARTIFACTS_DIR_NAME
126-
ARTIFACTS_URL=https://dl.fedoraproject.org/pub/alt/linuxsystemroles/logs/$ARTIFACTS_DIR_NAME
131+
ARTIFACTS_URL=https://dl.fedoraproject.org/pub/alt/${{ vars.LINUXSYSTEMROLES_USER }}/logs/$ARTIFACTS_DIR_NAME
127132
echo "DATETIME=$DATETIME" >> $GITHUB_OUTPUT
128133
echo "ARTIFACTS_DIR=$ARTIFACTS_DIR" >> $GITHUB_OUTPUT
129134
echo "ARTIFACTS_URL=$ARTIFACTS_URL" >> $GITHUB_OUTPUT
@@ -155,17 +160,18 @@ jobs:
155160
git_url: https://github.com/linux-system-roles/tft-tests
156161
git_ref: main
157162
pipeline_settings: '{ "type": "tmt-multihost" }'
163+
environment_settings: '{ "provisioning": { "tags": { "BusinessUnit": "system_roles" } } }'
164+
# Keeping ARTIFACTS_URL at the bottom makes the link in logs clickable
158165
variables: "ANSIBLE_VER=${{ matrix.ansible_version }};\
159166
REPO_NAME=${{ github.event.repository.name }};\
160167
GITHUB_ORG=${{ github.repository_owner }};\
161-
GITHUB_ORG=linux-system-roles;\
162168
PR_NUM=${{ github.event.issue.number }};\
163169
ARTIFACTS_DIR=${{ steps.set_vars.outputs.ARTIFACTS_DIR }};\
164-
ARTIFACTS_URL=${{ steps.set_vars.outputs.ARTIFACTS_URL }};\
165-
TEST_LOCAL_CHANGES=false"
170+
TEST_LOCAL_CHANGES=false;\
171+
LINUXSYSTEMROLES_USER=${{ vars.LINUXSYSTEMROLES_USER }};\
172+
ARTIFACTS_URL=${{ steps.set_vars.outputs.ARTIFACTS_URL }}"
166173
# Note that LINUXSYSTEMROLES_SSH_KEY must be single-line, TF doesn't read multi-line variables fine.
167-
secrets: "LINUXSYSTEMROLES_USER=${{ secrets.LINUXSYSTEMROLES_USER }};\
168-
LINUXSYSTEMROLES_DOMAIN=${{ secrets.LINUXSYSTEMROLES_DOMAIN }};\
174+
secrets: "LINUXSYSTEMROLES_DOMAIN=${{ secrets.LINUXSYSTEMROLES_DOMAIN }};\
169175
LINUXSYSTEMROLES_SSH_KEY=${{ secrets.LINUXSYSTEMROLES_SSH_KEY }}"
170176
compose: ${{ matrix.platform }}
171177
# There are two blockers for using public ranch:
@@ -175,6 +181,7 @@ jobs:
175181
api_key: ${{ secrets.TF_API_KEY_RH }}
176182
update_pull_request_status: false
177183
tmt_hardware: '{ "memory": ">= ${{ needs.prepare_vars.outputs.memory }} MB" }'
184+
tmt_plan_filter: "tag:general,postgresql"
178185

179186
- name: Set final commit status
180187
uses: myrotvorets/set-commit-status-action@master

.github/workflows/tft_citest_bad.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
citest_bad_rerun:
1111
if: |
1212
github.event.issue.pull_request
13-
&& github.event.comment.body == '[citest_bad]'
13+
&& contains(fromJson('["[citest_bad]", "[citest-bad]", "[citest bad]"]'), github.event.comment.body)
1414
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
1515
permissions:
1616
actions: write # for re-running failed jobs: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run

0 commit comments

Comments
 (0)