Skip to content

Commit c7c50ed

Browse files
authored
Add Tests.yml reusable workflow (#484)
1 parent 3d139d3 commit c7c50ed

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

.github/workflows/tests.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test_python:
8+
name: ${{ matrix.name }}
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
include:
13+
- os: ubuntu-latest
14+
name: py36-ubuntu
15+
python-version: 3.6
16+
17+
- os: windows-latest
18+
name: py36-windows
19+
python-version: 3.6
20+
21+
- os: macOS-latest
22+
name: py36-mac
23+
python-version: 3.6
24+
25+
- os: ubuntu-latest
26+
name: py37-ubuntu
27+
python-version: 3.7
28+
29+
- os: windows-latest
30+
name: py37-windows
31+
python-version: 3.7
32+
33+
- os: macOS-latest
34+
name: py37-mac
35+
python-version: 3.7
36+
37+
- os: ubuntu-latest
38+
name: py38-ubuntu
39+
python-version: 3.8
40+
41+
- os: windows-latest
42+
name: py38-windows
43+
python-version: 3.8
44+
45+
- os: macOS-latest
46+
name: py38-mac
47+
python-version: 3.8
48+
49+
- os: ubuntu-latest
50+
name: py39-ubuntu
51+
python-version: 3.9
52+
53+
- os: windows-latest
54+
name: py39-windows
55+
python-version: 3.9
56+
57+
- os: macOS-latest
58+
name: py39-mac
59+
python-version: 3.9
60+
61+
- os: ubuntu-latest
62+
name: pypy3-ubuntu
63+
python-version: pypy3
64+
65+
- os: windows-latest
66+
name: pypy3-windows
67+
python-version: pypy3
68+
# https://github.com/pytest-dev/pytest-html/issues/482
69+
# - os: macOS-latest
70+
# name: pypy3-mac
71+
# python-version: pypy3
72+
73+
- os: ubuntu-latest
74+
name: devel-ubuntu
75+
python-version: 3.9
76+
77+
steps:
78+
- name: Set Newline Behavior
79+
run : git config --global core.autocrlf false
80+
- uses: actions/checkout@master
81+
- name: Set up Python
82+
uses: actions/setup-python@v2
83+
with:
84+
python-version: ${{ matrix['python-version'] }}
85+
- name: Install tox
86+
run: python -m pip install --upgrade tox
87+
- name: Get Tox Environment Name From Matrix Name
88+
uses: rishabhgupta/split-by@v1
89+
id: split-matrix-name
90+
with:
91+
string: '${{ matrix.name }}'
92+
split-by: '-'
93+
- name: Test with tox
94+
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
95+
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
96+
# - name: Upload coverage to codecov
97+
# if: github.event.schedule == ''
98+
# uses: codecov/codecov-action@v2
99+
# with:
100+
# fail_ci_if_error: true
101+
# file: ./coverage.xml
102+
# flags: tests
103+
# name: ${{ matrix.py }} - ${{ matrix.os }}
104+
# verbose: true
105+
106+
test_javascript:
107+
name: grunt
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v2
111+
- name: Use Node.js ${{ matrix.node-version }}
112+
uses: actions/setup-node@v1
113+
with:
114+
node-version: '12.x'
115+
- name: Install Dependencies
116+
run: npm install
117+
- name: QUnit Tests
118+
run: npm test
119+
120+
linting:
121+
name: linting
122+
runs-on: ubuntu-latest
123+
steps:
124+
- uses: actions/checkout@master
125+
- name: Set up Python
126+
uses: actions/setup-python@v2
127+
with:
128+
python-version: 3.9
129+
- name: Install tox
130+
run: python -m pip install --upgrade tox
131+
- name: Lint with tox
132+
run: python -m tox -e linting

0 commit comments

Comments
 (0)