forked from ArtifexSoftware/mupdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows/test_csharp.yml: new, for testing C# bindings on gi…
…thub.
- Loading branch information
1 parent
2d2b1b8
commit faaafa5
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |