Skip to content

Commit

Permalink
Replace crypto (#22)
Browse files Browse the repository at this point in the history
If you're notified about this commit, bs1959, I'm working ahead on a rewrite of pretty much the whole library, and your openssl change was quite nice. This is mostly your work, with some resolved merge conflicts, clippy lints, and some perf improvements in tests.

---------

Co-authored-by: bs <[email protected]>
  • Loading branch information
einarmo and bs committed Dec 15, 2024
1 parent c00e7ba commit a5d560c
Show file tree
Hide file tree
Showing 32 changed files with 1,672 additions and 968 deletions.
34 changes: 10 additions & 24 deletions .github/workflows/ci_code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

# Crypto tests are excluded because the way rust does coverage makes them take 100x longer.
- name: Test with profiling data
run: cargo test
env:
CARGO_INCREMENTAL: 0
LLVM_PROFILE_FILE: 'cargo-test-%p-%m.profraw'
RUSTFLAGS: '-Cinstrument-coverage'
run: cargo llvm-cov --workspace --exclude opcua-crypto --codecov --output-path codecov.json

- name: Install grcov fast
uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: latest

- name: Add llvm-tools-preview
run: rustup component add llvm-tools-preview

- name: Create lcov output dir
run: |
mkdir target/coverage
- name: Generate lcov from profiling data
run: grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '**/generated/**/*' --ignore '**/integration/**/*' --ignore '**/tests/**/*' --ignore '../*' --ignore "/*" -o target/coverage/tests.lcov
- name: Run crypto tests
run: cargo test -p opcua-crypto

- name: Run core tests
run: cargo test -p opcua-core

- name: Upload lcov to codecov.io
uses: codecov/codecov-action@v4
with:
files: target/coverage/*.lcov

- name: Wipe stray profiling files
run: find . -type f -name "*.profraw"
files: codecov.json
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
- name: Provision toolchain
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build --features test-vendored-openssl
run: cargo build
- name: Run tests
run: cargo test --features test-vendored-openssl --verbose
run: cargo test --verbose

# build-windows:
# strategy:
Expand All @@ -40,9 +40,9 @@ jobs:
# - name: Provision toolchain
# run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
# - name: Build
# run: cargo build --features test-vendored-openssl
# run: cargo build
# - name: Run tests
# run: cargo test --features test-vendored-openssl --verbose
# run: cargo test --verbose

code-coverage:
uses: ./.github/workflows/ci_code_coverage.yml
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ log/
**/pki-client
**/pki-server
3rd-party/open62541/build/
lib/pki*
lib/pki*
lib/certs
Loading

0 comments on commit a5d560c

Please sign in to comment.