forked from robotframework/robotframework
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (120 loc) · 5.02 KB
/
acceptance_tests_cpython.yml
File metadata and controls
141 lines (120 loc) · 5.02 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Acceptance tests (CPython + PyPy)
on:
push:
paths:
- '.github/workflows/**'
- 'src/**'
- 'atest/**'
- '!**/*.rst'
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'atest/**'
- '!**/*.rst'
jobs:
test_using_builtin_python:
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', 'pypy2', 'pypy3' ]
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
exclude:
- os: windows-latest
python-version: 'pypy2'
- os: windows-latest
python-version: 'pypy3'
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup python for starting the tests
uses: actions/setup-python@v1
with:
python-version: 3.6
architecture: 'x64'
- name: Get test starter Python at Windows
run: echo "::set-env name=ATEST_PYTHON::$((get-command python.exe).Path)"
if: runner.os == 'Windows'
- name: Get test starter Python
run: echo "::set-env name=ATEST_PYTHON::$(which python)"
if: runner.os != 'Windows'
- name: Setup python ${{ matrix.python-version }} for running the tests
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Get test runner Python at Windows
run: echo "::set-env name=BASE_PYTHON::$((get-command python.exe).Path)"
if: runner.os == 'Windows'
- name: Get test runner Python
run: echo "::set-env name=BASE_PYTHON::$(which python)"
if: runner.os != 'Windows'
- name: Install Report handling tools to Windows
run: |
choco install curl -y --no-progress
choco install zip -y --no-progress
if: runner.os == 'Windows'
- name: Install report handling tools to Mac
run: |
brew install zip
brew install curl
if: runner.os == 'macOS'
- name: Install Ubuntu PyPy dependencies
run: |
sudo apt-get update
sudo apt-get -y -q install libxslt-dev libxml2-dev
if: contains(matrix.python-version, 'pypy') && contains(matrix.os, 'ubuntu')
- name: Install screen and report handling tools to Linux
run: |
sudo apt-get update
sudo apt-get -y -q install xvfb scrot zip curl
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 ${{ env.BASE_PYTHON }} --exclude no-ci atest/robot
- name: Delete output.xml (on Win)
run: |
Get-ChildItem atest/results -Include output.xml -Recurse | Remove-Item
if: always() && runner.os == 'Windows'
- name: Delete output.xml (on Unix-like)
run: |
find atest/results -type f -name 'output.xml' -exec rm {} +
if: always() && runner.os != 'Windows'
- name: Archive acceptances test results
uses: actions/upload-artifact@v1.0.0
with:
name: at-results-${{ matrix.python-version }}-${{ matrix.os }}
path: atest/results
if: always() && job.status == 'failure'
- name: Upload results
run: |
echo '<html><head><meta http-equiv = "refresh" content =" 0 ; url = /report.html"></head></html>' > atest/results/index.html
zip -r -j site.zip atest/results > no_output 2>&1
curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
echo "::set-env name=REPORT_URL::$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")"
echo "::set-env name=JOB_STATUS::$(python -c "print('${{ job.status }}'.lower())")"
if: always() && job.status == 'failure'
- uses: octokit/request-action@57ec46afcc4c58c813af3afe67e57ced1ea9f165
name: Update status with Github Status API
id: update_status
with:
route: POST /repos/:repository/statuses/:sha
repository: ${{ github.repository }}
sha: ${{ github.sha }}
state: "${{env.JOB_STATUS}}"
target_url: "${{env.REPORT_URL}}"
description: "Link to test report."
context: at-results-${{ matrix.python-version }}-${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always() && job.status == 'failure'