diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2023-04-29 12:48:00 +0200 |
|---|---|---|
| committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2023-04-29 13:41:33 +0200 |
| commit | 992a7dbbbdf61f5561edd26657806da134bb18da (patch) | |
| tree | cae9f4a24f0d72a1b4d849c035e3efd1b2d78472 /.github | |
| parent | a703aaa14576ddd9d07fa0af6abd76b331f54625 (diff) | |
| download | cryptography-coverage-nox.tar.gz | |
shift rust coverage into noxfilecoverage-nox
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20229b2b1..a92223a3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: - main - '*.*.x' + - coverage-nox tags: - '*.*' - '*.*.*' @@ -306,41 +307,20 @@ jobs: uses: ./.github/actions/wycheproof - run: python -m pip install -c ci-constraints-requirements.txt 'nox' coverage[toml] cffi - name: Create nox environment - run: nox -v --install-only -s tests + run: nox -v --install-only -s rust_coverage env: CARGO_TARGET_DIR: ${{ format('{0}/src/rust/target/', github.workspace) }} - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "rust-cov/cov-%p.profraw" - name: Tests - run: nox --no-install -s tests -- --color=yes --wycheproof-root=wycheproof + run: nox --no-install -s rust_coverage -- --color=yes --wycheproof-root=wycheproof env: COLUMNS: 80 CARGO_TARGET_DIR: ${{ format('{0}/src/rust/target/', github.workspace) }} - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "rust-cov/cov-%p.profraw" - - name: Rust Tests - run: | - cd src/rust - cargo test --no-default-features --all - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "rust-cov/cov-%m-%p.profraw" - name: Process coverage data run: | set -xe - cd src/rust/ - cargo profdata -- merge -sparse $(find ../.. -iname "*.profraw") -o rust-cov.profdata + sed -E -i 's/SF:(.*)\/src\/rust\/(.*)/SF:src\/rust\/\2/g' cov.lcov COV_UUID=$(python3 -c "import uuid; print(uuid.uuid4())") - - cargo cov -- export \ - ../../.nox/tests/lib/python${{ matrix.PYTHON }}/site-packages/cryptography/hazmat/bindings/_rust.abi3.so \ - $(env RUSTFLAGS="-Cinstrument-coverage" cargo test --no-default-features --all --tests --no-run --message-format=json | jq -r "select(.profile.test == true) | .filenames[]" | awk '{print "-object " $0}') \ - -instr-profile=rust-cov.profdata \ - --ignore-filename-regex='/.cargo/' \ - --ignore-filename-regex='/rustc/' \ - --ignore-filename-regex='/.rustup/toolchains/' --format=lcov > "../../${COV_UUID}.lcov" - - sed -E -i 's/SF:(.*)\/src\/rust\/(.*)/SF:src\/rust\/\2/g' "../../${COV_UUID}.lcov" + mv cov.lcov "${COV_UUID}.lcov" - uses: ./.github/actions/upload-coverage macos: |
