Skip to content

Commit

Permalink
Use dlltracer in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis <[email protected]>
  • Loading branch information
DarkaMaul committed Nov 5, 2024
1 parent 12fb4b5 commit 78ce65f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
Expand All @@ -72,11 +74,11 @@ jobs:
curl.exe -o "c:\\${env:OPENSSL_INSTALLER}" -fsSL "https://slproweb.com/download/${env:OPENSSL_INSTALLER}"
Start-Process -FilePath "c:\\${env:OPENSSL_INSTALLER}" -ArgumentList "/silent /verysilent /DIR=${env:OPENSSL_PATH}" -NoNewWindow -Wait
- name: Setup rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
components: rustfmt
toolchain: 1.81.0
# - name: Setup rust
# uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
# with:
# components: rustfmt
# toolchain: 1.81.0

- name: Setup env variables
shell: bash
Expand All @@ -88,14 +90,14 @@ jobs:
- name: test
run: |
$PYO3_PYTHON -m venv env-local
uv venv env-local
. env-local/Scripts/activate
pip install -e '.[test]'
pytest --cov=rfc3161_client
uv pip install dlltracer
uv pip install -e '.[test]'
python main.py
# make test INSTALL_EXTRA=test
shell: bash
env:
OPENSSL_DIR: "C:\\OpenSSL-Win64"
OPENSSL_LIB_DIR: "C:\\OpenSSL-Win64\\lib\\VC\\x64\\MD"
OPENSSL_NO_VENDOR: 1
UV_NO_CACHE: true
20 changes: 20 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import sys
import os
from pathlib import Path

import dlltracer


def add_dll():
if openssl_dir := os.environ.get("OPENSSL_DIR"):
os.add_dll_directory(openssl_dir)
print(f"Dlls : {list(Path(openssl_dir).glob('*.dll'))}")

if pyo3_python := os.environ.get("PYO3_PYTHON"):
python_dir = Path(pyo3_python).parent
print(f"Dlls ({python_dir}) : {list(Path(python_dir).glob('*.dll'))}")
os.add_dll_directory(python_dir.as_posix())


with dlltracer.Trace(out=sys.stdout):
import rfc3161_client

0 comments on commit 78ce65f

Please sign in to comment.