Skip to content

Commit

Permalink
Add GH Actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
avylove committed Dec 24, 2022
1 parent 26ecc7e commit 953d0bd
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 10 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,65 @@
name: Tests

on:
push:
pull_request:
release:
schedule:
# Every Thursday at 1 AM
- cron: '0 1 * * 4'

jobs:

Tests:
runs-on: ${{ matrix.os || 'windows-latest' }}
name: ${{ startsWith(matrix.toxenv, 'py') && format('{0}-{1}', matrix.python-version, matrix.python-arch) || format('{0} ({1}-{2})', matrix.toxenv, matrix.python-version, matrix.python-arch) }} ${{ matrix.optional && '[OPTIONAL]' }}
continue-on-error: ${{ matrix.optional || false }}

strategy:
fail-fast: false

matrix:
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-arch: ['x86', 'x64']
toxenv: [pywin]


include:

- toxenv: lint
python-version: 3.x
python-arch: x64
os: ubuntu-latest

- toxenv: codecov
python-version: 3.x
python-arch: x64

- python-version: '3.12-dev'
optional: true
python-arch: x86
toxenv: pywin

- python-version: '3.12-dev'
optional: true
python-arch: x64
toxenv: pywin

env:
TOXENV: ${{ matrix.toxenv }}
TOXPYTHON: python${{ matrix.toxpython || matrix.python-version }}

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-arch }}

- name: Install tox
run: pip install tox

- name: Run tox
run: tox -- --verbose
23 changes: 13 additions & 10 deletions tox.ini
@@ -1,16 +1,15 @@
[tox]
ignore_basepython_conflict = True
ignore_basepython_conflict = False
envlist = lint


[testenv]
basepython = python3.9
commands =
{envpython} -m unittest discover -s {toxinidir}/tests {posargs}


[testenv:pywin]
basepython = {env:PYTHON}\python.exe
basepython = {env:pythonLocation:{env:PYTHON:}}\python.exe
commands =
{envpython} -c "import sys, struct; print(sys.version); print(str(struct.calcsize('P') * 8) + '-bit')"
{[testenv]commands}
Expand All @@ -21,21 +20,25 @@ deps =
coverage

commands =
{envpython} -m coverage run -m unittest discover -s {toxinidir}/tests {posargs}
{envpython} -m coverage report
coverage run -m unittest discover -s {toxinidir}/tests {posargs}
coverage report


[testenv:codecov]
passenv = CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* COVERALLS_REPO_TOKEN
passenv =
CI
APPVEYOR
APPVEYOR_*
COVERALLS_REPO_TOKEN
deps =
{[testenv:coverage]deps}
# codecov
coveralls

commands =
{[testenv:coverage]commands}
# {envpython} -m codecov
{envpython} -m coveralls
# codecov
coveralls


[testenv:flake8]
Expand All @@ -44,7 +47,7 @@ deps =
flake8

commands =
{envpython} -m flake8
flake8


[testenv:pylint]
Expand All @@ -55,7 +58,7 @@ deps =
pyenchant

commands =
{envpython} -m pylint ansicon tests setup.py
pylint ansicon tests setup.py


[testenv:lint]
Expand Down

0 comments on commit 953d0bd

Please sign in to comment.