Skip to content

Commit d4744b3

Browse files
Add GitHub Actions workflow for Python package testing
1 parent 6f47f11 commit d4744b3

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

.github/workflows/test.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Python package
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
platform: [ubuntu-20.04, windows-latest]
12+
runs-on: ${{ matrix.platform }}
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python 3.6
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.6'
19+
- name: Set up Python 3.8
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.8'
23+
- name: Set up Python 3.10
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.10'
27+
- name: Set up Python 3.12
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.12'
31+
- name: Install dependencies
32+
run: |
33+
python3.12 -m pip install --upgrade pip
34+
python3.12 -m pip install tox tox-gh-actions
35+
- name: Test with tox
36+
run: python3.12 -m tox

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@ venv/
138138

139139
# VS Code
140140
.vscode
141+
142+
.python-version

tox.ini

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
1+
[tox]
2+
envlist = py36, py37, py38, py39, py310, py311, py312
3+
requires = virtualenv < 20.22.0
4+
isolated_build = true
5+
16
[testenv]
2-
commands=python unit_test.py
7+
deps =
8+
xeger
9+
colorful
10+
commands = python unit_test.py
11+
allowlist_externals = poetry
12+
13+
[gh-actions]
14+
python =
15+
3.6: py36
16+
3.7: py37
17+
3.8: py38
18+
3.9: py39
19+
3.10: py310
20+
3.11: py311
21+
3.12: py312

0 commit comments

Comments
 (0)