Skip to content

Commit a0ea5da

Browse files
committed
Enables testing s2i-python-container by PyTest suite.
This blocks: sclorg#768 Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 4af7a1e commit a0ea5da

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
3+
on:
4+
issue_comment:
5+
types:
6+
- created
7+
jobs:
8+
distgen-check:
9+
name: "Check distgen generated files"
10+
runs-on: ubuntu-latest
11+
if: |
12+
github.event.issue.pull_request
13+
&& (contains(github.event.comment.body, '[test-pytest]') || contains(github.event.comment.body, '[test-all]'))
14+
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v5
18+
with:
19+
ref: "refs/pull/${{ github.event.issue.number }}/head"
20+
submodules: true
21+
22+
- name: Check distgen generated files
23+
id: check
24+
shell: bash
25+
run: |
26+
sha=$(git rev-parse HEAD)
27+
sudo apt update && sudo apt -y install python3-pip
28+
pip3 install pyyaml distgen Jinja2
29+
result="success"
30+
./common/tests/check_distgen_generated_files.sh || result="failure"
31+
echo "result=$result" >> "$GITHUB_OUTPUT"
32+
echo "sha=$sha" >> "$GITHUB_OUTPUT"
33+
34+
- name: Set final commit status
35+
uses: myrotvorets/set-commit-status-action@v2.0.0
36+
with:
37+
status: ${{ steps.check.outputs.result }}
38+
context: "Distgen check"
39+
sha: ${{ steps.check.outputs.sha }}
40+
41+
- name: Exit on ERR
42+
shell: bash
43+
run: |
44+
_result=${{ steps.check.outputs.result }}
45+
if [ "$_result" == failure ]; then
46+
echo "Distgen-generated files are not regenerated properly."
47+
echo "Please regenerate them with:"
48+
echo "'make clean-versions'"
49+
echo "'make generate-all'"
50+
exit 1
51+
fi
52+
53+
container-tests:
54+
needs: distgen-check
55+
name: "Container PyTest: ${{ matrix.version }} - ${{ matrix.os_test }}"
56+
runs-on: ubuntu-latest
57+
concurrency:
58+
group: container-pytest-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }}
59+
cancel-in-progress: true
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
version: [ "3.9", "3.9-minimal", "3.11", "3.11-minimal", "3.12", "3.12-minimal", "3.13" ]
64+
os_test: [ "fedora", "rhel8", "rhel9", "rhel10", "c9s", "c10s" ]
65+
test_case: [ "container-pytest" ]
66+
if: |
67+
github.event.issue.pull_request
68+
&& (contains(github.event.comment.body, '[test-pytest]') || contains(github.event.comment.body, '[test-all]'))
69+
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
70+
steps:
71+
- uses: sclorg/tfaga-wrapper@main
72+
with:
73+
os_test: ${{ matrix.os_test }}
74+
version: ${{ matrix.version }}
75+
test_case: ${{ matrix.test_case }}
76+
public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }}
77+
private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }}

0 commit comments

Comments
 (0)