Skip to content

Commit

Permalink
Merge pull request #306 from jonathangreen/feature/static-build-ci
Browse files Browse the repository at this point in the history
Add CI action for OSX static build
  • Loading branch information
mxamin authored Apr 8, 2024
2 parents 53e0d81 + 47e711b commit 6c5b695
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 6c5b695

Please sign in to comment.