-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
82 lines (73 loc) · 3.16 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
name: 'Run Testing Farm as GitHub Action for SCLOrg use-cases'
description: 'This wrapper tries to minimize lines of code needed to be written in each container repository when calling TFaGA. This should lead to code reduction, duplicity removal, easier maintaining and adding features.'
author: 'RHSCL team'
inputs:
version:
description: ''
required: true
os_test:
description: 'c9s/c10s/fedora/rhel8/rhel9/rhel9-unsubscribed/rhel10/rhel10-unsubscribed'
required: true
test_case:
description: 'container/openshift-4'
required: true
public_api_key:
description: ''
required: true
private_api_key:
description: ''
required: true
working_dir: # used for s2i-core and s2i-base images only
description: ''
required: false
context: # used for user-defined prefix context
description: ''
required: false
runs:
using: 'composite'
steps:
- name: Set working dir
id: working_dir
shell: bash
run: |
_path=${{ inputs.working_dir }}
if [ "$_path" == "" ]; then
echo "path=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
else
echo "path=$_path" >> "$GITHUB_OUTPUT"
fi
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"
- run: echo "${{ github.action_path }}" >> "$GITHUB_PATH"
shell: bash
- name: Prepare needed variables
shell: bash
id: vars
run: export_variables.sh "${{ inputs.os_test }}" "${{ inputs.test_case }}" "${{ inputs.context }}"
- name: Check if ${{ steps.working_dir.outputs.path }}/${{ steps.vars.outputs.dockerfile }} is present
id: check_dockerfile
uses: andstor/file-existence-action@v2
with:
files: "${{ steps.working_dir.outputs.path }}/${{ steps.vars.outputs.dockerfile }}"
- name: Check .exclude-${{ steps.vars.outputs.os_test }} file presents
id: check_exclude_file
uses: andstor/file-existence-action@v2
with:
files: "${{ steps.working_dir.outputs.path }}/.exclude-${{ steps.vars.outputs.os_test }}"
- name: Schedule tests for ${{ steps.working_dir.outputs.path }} - ${{ steps.vars.outputs.os_test }}
if: ${{ steps.check_exclude_file.outputs.files_exists == 'false' && steps.check_dockerfile.outputs.files_exists == 'true' }}
uses: sclorg/testing-farm-as-github-action@main
with:
api_key: ${{ inputs[steps.vars.outputs.api_key] }}
compose: ${{ steps.vars.outputs.compose }}
git_url: ${{ steps.vars.outputs.tmt_repo }}
git_ref: ${{ steps.vars.outputs.branch }}
tf_scope: ${{ steps.vars.outputs.tf_scope }}
tmt_plan_regex: ${{ steps.vars.outputs.tmt_plan }}
update_pull_request_status: true
create_issue_comment: true
pull_request_status_name: "${{ steps.vars.outputs.context }} - ${{ steps.working_dir.outputs.path }}"
variables: "REPO_URL=${{ github.server_url }}/${{ github.repository }};REPO_NAME=${{ github.repository }};PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ inputs.version }};OS=${{ steps.vars.outputs.os_test }};TEST_NAME=${{ steps.vars.outputs.test_name }}"