Skip to content

Clean up wasm dependencies #676

Clean up wasm dependencies

Clean up wasm dependencies #676

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
rustflags:
- ''
- '-C target-feature=-avx2'
- '-C target-feature=-avx2,-pclmulqdq'
features:
- '--no-default-features'
- ''
- '--features value-no-dup-keys'
- '--features known-key'
- '--features 128bit'
- '--features beef'
- '--features beef,known-key'
- '--features beef,known-key,128bit'
- '--features approx-number-parsing'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests (alloc)
if: matrix.features == ''
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo test --features alloc
- name: Run tests
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --lcov --output-path lcov.txt --features no-inline ${{ matrix.features }}
- name: Generate matrix name
if: matrix.os == 'ubuntu-latest'
run: |
flags="${{ matrix.rustflags }}${{ matrix.features }}"
flags="${flags/-C target-feature=/}"
flags="${flags//[- ]/}"
echo "$flags"
echo "flags=$flags" >> $GITHUB_ENV
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: Wandalen/wretry.action@master
with:
action: codecov/codecov-action@v3
attempt_limit: 6
attempt_delay: 10000
with: |
files: ./lcov.txt
flags: unittests
verbose: true
wasm:
strategy:
matrix:
features:
- '--no-default-features'
- ''
- '--features value-no-dup-keys'
- '--features known-key'
- '--features 128bit'
- '--features beef'
- '--features beef,known-key'
- '--features beef,known-key,128bit'
- '--features approx-number-parsing'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
targets: wasm32-unknown-unknown
- name: Compile
run: cargo build --target wasm32-unknown-unknown --features no-inline ${{ matrix.features }}