Skip to content

Commit

Permalink
Switch from Travis to github actions
Browse files Browse the repository at this point in the history
Github actions allows to run unittests on all platforms
  • Loading branch information
mrh1997 committed Sep 12, 2023
1 parent 5edffb3 commit c2664f5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 30 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build headlock and run unittests
on: [push]

jobs:

###################################################
unittests:

strategy:
fail-fast: false
matrix:
python: [3.6, 3.7, 3.8, 3.9, "3.10", 3.11]
os: [windows-2022]
arch: [x64]

runs-on: ${{matrix.os}}

steps:

- name: Checkout Repository
uses: actions/[email protected]
with:
submodules: true

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

- name: Install tox
shell: bash
run: pip install tox==3.15

- name: Run Unittests
shell: bash
run: |
if [ ${{matrix.os}} = "windows-2022" ]
then export MINGW_X86_64_DIR=C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64
fi
tox -e py${{matrix.python}}-${{matrix.arch}}
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion headlock/c_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Dict, List, Any, ByteString, Union

from .libclang.cindex import CursorKind, StorageClass, TypeKind, \
TranslationUnit, Config, TranslationUnitLoadError, Cursor, Type
TranslationUnit, Config, TranslationUnitLoadError, LibclangError, Type
from .c_data_model import BuildInDefs, CProxyType, CFuncType, CStructType, \
CUnionType, CEnumType, CVectorType, CStruct, CUnion, CEnum, CArrayType

Expand Down Expand Up @@ -438,6 +438,9 @@ def sys_inc_dir_args(sys_include_dirs):
+ ([] if not self.target_compiler
else [f'--target={self.target_compiler}']),
options=TranslationUnit.PARSE_DETAILED_PROCESSING_RECORD)
except LibclangError as e:
raise ParseError(str(e) + "\nMaybe libclang library is not found. "
"You might specify its path with LLVM_DIR")
except TranslationUnitLoadError as e:
raise FileNotFoundError(
f'File {os.fspath(file_name)} cannot be opened/is invalid') \
Expand Down
27 changes: 14 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[tox]
envlist=py3{6,7,8,9,10,11}-{x86,x64}, docs
envlist=py3.{6,7,8,9,10,11}-{x86,x64}, docs
skip_missing_interpreters = true
minversion = 3.15.0

Expand All @@ -11,23 +11,24 @@ deps =
setuptools
twine
basepython =
py36-x86: python3.6-32
py36-x64: python3.6-64
py37-x86: python3.7-32
py37-x64: python3.7-64
py38-x86: python3.8-32
py38-x64: python3.8-64
py39-x86: python3.9-32
py39-x64: python3.9-64
py310-x86: python3.10-32
py310-x64: python3.10-64
py311-x86: python3.11-32
py311-x64: python3.11-64
py3.6-x86: python3.6-32
py3.6-x64: python3.6-64
py3.7-x86: python3.7-32
py3.7-x64: python3.7-64
py3.8-x86: python3.8-32
py3.8-x64: python3.8-64
py3.9-x86: python3.9-32
py3.9-x64: python3.9-64
py3.10-x86: python3.10-32
py3.10-x64: python3.10-64
py3.11-x86: python3.11-32
py3.11-x64: python3.11-64
commands = pytest
passenv=
HEADLOCK_LOG
MINGW_I686_DIR
MINGW_X86_64_DIR
LLVM_DIR


[testenv:docs]
Expand Down

0 comments on commit c2664f5

Please sign in to comment.