-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (47 loc) · 1.67 KB
/
test_csharp.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
name: Build and test of C# Bindings
on:
schedule:
- cron: '3 5 * * *'
workflow_dispatch:
jobs:
test:
name: Build and test of C# Bindings
runs-on: ${{ matrix.os }}
strategy:
matrix:
#os: [ubuntu-20.04, windows-2019, macos-10.15]
# 2023-02-10: Clang-python appears to not find any functions on macos.
os: [ubuntu-20.04, windows-2019]
# Avoid cancelling of all runs after a single failure.
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
- name: Build and test of C# Bindings
# We use a python script to run a series of commands, all inside a venv
# so that clang-python is available.
#
run: |
import os
import platform
import subprocess
import sys
def run(command):
print(f'Running: {command}')
sys.stdout.flush()
subprocess.run( command, shell=True, check=True)
if platform.system() == 'Linux':
run(f'sudo apt install swig')
venv_name = 'pylocal'
command = ''
command += f'{sys.executable} -m venv {venv_name}'
if platform.system() == 'Windows':
command += f' && .\\{venv_name}\\Scripts\\activate'
else:
command += f' && . {venv_name}/bin/activate'
command += f' && python -m pip install -U pip libclang'
command += f' && python scripts/mupdfwrap.py --swig-windows-auto -b --csharp all --test-csharp'
run( command)
shell: python