-
-
Notifications
You must be signed in to change notification settings - Fork 56
106 lines (98 loc) · 3.36 KB
/
ctypeslib-linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# good example https://github.com/thenewguy/django-randomfields/blob/master/.github/workflows/sdist.yml
name: ctypeslib-linux
on: [push, pull_request]
jobs:
check-package-build:
name: Build & inspect our package.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# get all history and tags for setuptools_scm to find the right version
fetch-depth: 0
- name: Install build dependencies
run: |
pip install setuptools setuptools_scm wheel build
- name: Build package wheel
run: python -m build -w
- name: Upload built artifacts.
uses: actions/upload-artifact@v3
with:
name: Packages
path: ./dist/*
# - uses: hynek/build-and-inspect-python-package@v1
# id: build-package
# packages are uploaded to Packages
test:
needs: check-package-build
runs-on: ubuntu-latest
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# python-version: [ 3.5, 3.6, 3.7, 3.8, 3.9 ]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
clang-version: ['11', '12', '13', '14']
# clang 15+ is C2X standard and requires cleaning up C code in test libs
# https://github.com/madler/zlib/issues/633
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Clang
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.clang-version }}
platform: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm clang==${{ matrix.clang-version }}.* coveralls coverage[toml]
- name: build test libs
run: |
CFLAGS="-Wall -Wextra -Werror -std=c99 -pedantic -fpic"
LDFLAGS="-shared"
clang $CFLAGS $LDFLAGS -o test/data/test-callbacks.so test/data/test-callbacks.c
- name: Show LD_LIBRARY_PATH
run: |
echo $LD_LIBRARY_PATH
echo $PWD
echo $(pwd)
echo ${{runner.os == 'Linux' }}
- name: Update Linux LD_LIBRARY_PATH
if: ${{runner.os == 'Linux' }}
run: |
echo "LD_LIBRARY_PATH=$(pwd)/test/data/:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Update Windows PATH
if: ${{runner.os == 'Windows' }}
run: |
echo "PATH=$(pwd)/test/data/:$Env:PATH" >> $GITHUB_ENV
- name: Update macOS PATH
if: ${{runner.os == 'macOS' }}
run: |
echo "DYLD_LIBRARY_PATH=$(pwd)/test/data/:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
with:
name: Packages
path: ~/packages/
- name: Install the package that was built
run: |
pip install ~/packages/ctypeslib2*.whl
- name: Run tests with Unittest and coverage
run: |
coverage run --source=ctypeslib -m unittest test.alltests
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: run-${{ join(matrix.*, ' - ') }}
coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true