Skip to content

Commit 503e16d

Browse files
author
Christopher Doris
committed
add python testing
1 parent d1e8e6d commit 503e16d

File tree

2 files changed

+43
-8
lines changed

2 files changed

+43
-8
lines changed

.github/workflows/tests.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
- '*'
1212

1313
jobs:
14-
tests:
15-
name: Test (${{ matrix.os }}-${{ matrix.arch }}, julia ${{ matrix.jlversion }})
14+
julia:
15+
name: Test (${{ matrix.os }}, julia ${{ matrix.jlversion }})
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
fail-fast: false
@@ -22,7 +22,8 @@ jobs:
2222
jlversion: ['1','1.6']
2323
steps:
2424
- uses: actions/checkout@v2
25-
- uses: julia-actions/setup-julia@v1
25+
- name: Set up Julia ${{ matrix.jlversion }}
26+
uses: julia-actions/setup-julia@v1
2627
with:
2728
version: ${{ matrix.jlversion }}
2829
arch: ${{ matrix.arch }}
@@ -36,11 +37,43 @@ jobs:
3637
${{ runner.os }}-test-${{ env.cache-name }}-
3738
${{ runner.os }}-test-
3839
${{ runner.os }}-
39-
- uses: julia-actions/julia-buildpkg@v1
40-
- uses: julia-actions/julia-runtest@v1
40+
- name: Build package
41+
uses: julia-actions/julia-buildpkg@v1
42+
- name: Run tests
43+
uses: julia-actions/julia-runtest@v1
4144
env:
4245
JULIA_DEBUG: PythonCall
43-
- uses: julia-actions/julia-processcoverage@v1
44-
- uses: codecov/codecov-action@v1
46+
- name: Process coverage
47+
uses: julia-actions/julia-processcoverage@v1
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v2
50+
python:
51+
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
matrix:
55+
os: [ubuntu-latest, windows-latest, macos-latest]
56+
pyversion: ["3.7", "3.10"]
57+
steps:
58+
- uses: actions/checkout@v3
59+
- name: Set up Python ${{ matrix.pyversion }}
60+
uses: actions/setup-python@v4
4561
with:
46-
file: lcov.info
62+
python-version: ${{ matrix.pyversion }}
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install flake8 pytest pytest-cov
67+
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
68+
pip install -e .
69+
- name: Lint with flake8
70+
run: |
71+
# stop the build if there are Python syntax errors or undefined names
72+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
73+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
74+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
75+
- name: Run tests
76+
run: |
77+
pytest --cov=src
78+
- name: Upload coverage to Codecov
79+
uses: codecov/codecov-action@v2

pytest/test_all.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_import():
2+
import juliacall

0 commit comments

Comments
 (0)