Update osx workflow #366
Workflow file for this run
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
name: MacOS | |
on: [push, pull_request] | |
jobs: | |
macosx: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install build dependencies | |
run: | | |
pip install --upgrade pip setuptools wheel build | |
brew install libxml2 libxmlsec1 pkg-config | |
- name: Build macosx_x86_64 wheel | |
env: | |
CC: clang | |
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping -I/usr/local/opt/libxml2/include" | |
LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping -L/usr/local/opt/libxml2/lib" | |
PKG_CONFIG_PATH: "/usr/local/opt/libxml2/lib/pkgconfig" | |
run: | | |
python -m build | |
rm -rf build/ | |
- name: Set environment variables | |
shell: bash | |
run: | | |
echo "PKGVER=$(python setup.py --version)" >> $GITHUB_ENV | |
echo "LLVM_PROFILE_FILE=pyxmlsec.profraw" >> $GITHUB_ENV | |
- name: Install test dependencies | |
run: | | |
pip install coverage --upgrade -r requirements-test.txt | |
pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/ | |
echo "PYXMLSEC_LIBFILE=$(python -c 'import xmlsec; print(xmlsec.__file__)')" >> $GITHUB_ENV | |
- name: Run tests | |
run: | | |
coverage run -m pytest -v --color=yes | |
- name: Report coverage to codecov | |
run: | | |
/Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse ${{ env.LLVM_PROFILE_FILE }} -output pyxmlsec.profdata | |
/Library/Developer/CommandLineTools/usr/bin/llvm-cov -arch x86_64 show ${{ env.PYXMLSEC_LIBFILE }} -instr-profile=pyxmlsec.profdata src > coverage.txt | |
bash <(curl -s https://codecov.io/bash) -f coverage.txt |