Skip to content

Add CI action for OSX static build #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
strategy:
matrix:
python: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
static_deps: ["static", ""]
steps:
- uses: actions/checkout@v3
- name: Setup Python
Expand All @@ -21,6 +22,7 @@ jobs:
CC: clang
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
PYXMLSEC_STATIC_DEPS: ${{ matrix.static_deps }}
run: |
export PKG_CONFIG_PATH="$(brew --prefix)/opt/libxml2/lib/pkgconfig"
python -m build
Expand All @@ -43,3 +45,4 @@ jobs:
/Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse ${{ env.LLVM_PROFILE_FILE }} -output pyxmlsec.profdata
/Library/Developer/CommandLineTools/usr/bin/llvm-cov show ${{ env.PYXMLSEC_LIBFILE }} --arch=$(uname -m) --instr-profile=pyxmlsec.profdata src > coverage.txt
bash <(curl -s https://codecov.io/bash) -f coverage.txt
if: matrix.static_deps != 'static'
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def make_request(url, github_token=None, json_response=False):
headers['authorization'] = "Bearer " + github_token
request = Request(url, headers=headers)
with contextlib.closing(urlopen(request)) as r:
charset = r.headers.get_content_charset() or 'utf-8'
content = r.read().decode(charset)
if json_response:
return json.load(r)
return json.loads(content)
else:
charset = r.headers.get_content_charset() or 'utf-8'
content = r.read().decode(charset)
return content


Expand Down