forked from robotframework/robotframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacceptance_tests_cpython_pr.yml
More file actions
114 lines (95 loc) · 3.78 KB
/
acceptance_tests_cpython_pr.yml
File metadata and controls
114 lines (95 loc) · 3.78 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Acceptance tests (CPython)
on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'atest/**'
- '!**/*.rst'
jobs:
test_using_builtin_python:
strategy:
fail-fast: true
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
python-version: [ '3.8', '3.13' ]
include:
- os: ubuntu-latest
set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
- os: windows-latest
set_codepage: chcp 850
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup python for starting the tests
uses: actions/setup-python@v5.4.0
with:
python-version: '3.13'
architecture: 'x64'
- name: Get test starter Python at Windows
run: echo "ATEST_PYTHON=$((get-command python.exe).Path)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: runner.os == 'Windows'
- name: Get test starter Python
run: echo "ATEST_PYTHON=$(which python)" >> $GITHUB_ENV
if: runner.os != 'Windows'
- name: Setup python ${{ matrix.python-version }} for running the tests
uses: actions/setup-python@v5.4.0
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Get test runner Python at Windows
run: echo "BASE_PYTHON=$((get-command python.exe).Path)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: runner.os == 'Windows'
- name: Get test runner Python
run: echo "BASE_PYTHON=$(which python)" >> $GITHUB_ENV
if: runner.os != 'Windows'
- name: Install screen and other required libraries to Linux
run: |
sudo apt-get update
sudo apt-get -y -q install xvfb scrot libxml2-dev libxslt1-dev
if: contains(matrix.os, 'ubuntu')
- name: Run acceptance tests
run: |
python -m pip install -r atest/requirements.txt
${{ env.ATEST_PYTHON }} -m pip install -r atest/requirements-run.txt
${{ matrix.set_codepage }}
${{ matrix.set_display }}
${{ env.ATEST_PYTHON }} atest/run.py --interpreter ${{ env.BASE_PYTHON }} --exclude no-ci ${{ matrix.atest_args }} atest/robot
- name: Archive acceptances test results
uses: actions/upload-artifact@v4
with:
name: at-results-${{ matrix.python-version }}-${{ matrix.os }}
path: atest/results
if: always() && job.status == 'failure'
- name: Install and run rflogs
if: failure()
env:
RFLOGS_API_KEY: ${{ secrets.RFLOGS_API_KEY }}
working-directory: atest/results
shell: python
run: |
import os
import glob
import subprocess
# Install rflogs
subprocess.check_call(["pip", "install", "rflogs"])
# Find the first directory containing log.html
log_files = glob.glob("**/log.html", recursive=True)
if log_files:
result_dir = os.path.dirname(log_files[0])
print(f"Result directory: {result_dir}")
# Construct the rflogs command
cmd = [
"rflogs", "upload",
"--tag", f"workflow:${{ github.workflow }}",
"--tag", f"os:${{ runner.os }}",
"--tag", f"python-version:${{ matrix.python-version }}",
"--tag", f"branch:${{ github.head_ref || github.ref_name }}",
result_dir
]
# Run rflogs upload
subprocess.check_call(cmd)
else:
print("No directory containing log.html found")
exit(1)