Skip to content

Commit ea86e02

Browse files
authored
Merge pull request #148 from hoefling/macosx-record-coverage
Record coverage in MacOS jobs
2 parents d76ecd9 + 75cc6c0 commit ea86e02

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

.github/workflows/macosx.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,29 @@ jobs:
1616
run: |
1717
pip install --upgrade pip setuptools wheel
1818
brew install libxml2 libxmlsec1 pkg-config
19+
- name: Build macosx_x86_64 wheel
20+
run: |
21+
python setup.py bdist_wheel
1922
- name: Set environment variables
2023
shell: bash
2124
run: |
2225
echo ::set-env name=PKGVER::$(python setup.py --version)
23-
- name: Build macosx_x86_64 wheel
24-
run: |
25-
python setup.py bdist_wheel
26+
echo ::set-env name=LLVM_PROFILE_FILE::"pyxmlsec-%p.profraw"
2627
- name: Install test dependencies
28+
env:
29+
CC: clang
30+
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
31+
LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
2732
run: |
28-
pip install --upgrade -r requirements-test.txt
29-
pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
33+
rm -rf build/
34+
pip install coverage --upgrade -r requirements-test.txt
35+
pip install --editable .
3036
- name: Run tests
3137
run: |
32-
pytest -v --color=yes
38+
coverage run -m pytest -v --color=yes
39+
- name: Report coverage to codecov
40+
run: |
41+
LIBFILE=$(python -c "import xmlsec; print(xmlsec.__file__)")
42+
/Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse pyxmlsec-*.profraw -output pyxmlsec.profdata
43+
/Library/Developer/CommandLineTools/usr/bin/llvm-cov show ${LIBFILE} -instr-profile=pyxmlsec.profdata src > coverage.txt
44+
bash <(curl -s https://codecov.io/bash) -f coverage.txt

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ addons:
3535
- lcov
3636
install:
3737
- travis_retry pip install --upgrade pip setuptools wheel
38-
- travis_retry pip install coverage codecov -r requirements-test.txt --upgrade --force-reinstall
38+
- travis_retry pip install coverage -r requirements-test.txt --upgrade --force-reinstall
3939
- travis_retry pip install -e "."
4040
- pip list
4141
script: coverage run -m pytest -v tests --color=yes
4242
after_success:
4343
- lcov --capture --directory . --output-file coverage.info
4444
- lcov --list coverage.info
45-
- codecov --file coverage.info
45+
- bash <(curl -s https://codecov.io/bash) -f coverage.info
4646
before_deploy:
4747
- travis_retry pip install Sphinx -r doc/source/requirements.txt
4848
- git apply --verbose --no-index --unsafe-paths --directory=$(python -c "import site; print(site.getsitepackages()[0])") doc/source/sphinx-pr-6916.diff

0 commit comments

Comments
 (0)