'sculpting' as an opt-in feature #107
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: scalpel build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: (${{ matrix.target}}, ${{ matrix.cfg_release_channel }}) | |
strategy: | |
matrix: | |
target: [ | |
x86_64-unknown-linux-gnu, | |
] | |
cfg_release_channel: [ stable, nightly, beta ] | |
python_version: [ '3.7', '3.8', '3.9', '3.10' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: install libpcap | |
run: | | |
sudo apt install -y libpcap-dev | |
- name: install maturin | |
run: | | |
python -m pip install maturin==0.13.6 | |
- name: install rustup | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh | |
sh rustup-init.sh -y --default-toolchain none | |
rustup target add ${{ matrix.target }} | |
rustup default ${{ matrix.cfg_release_channel }} | |
- name: Build with Python Bindings | |
run: | | |
maturin build --verbose --features python-bindings,logging --release --out dist | |
- name: Run tests with Python Bindings | |
run: | | |
rustc -Vv | |
cargo -V | |
cargo test --verbose --features python-bindings,logging | |
python -m pip install scalpel_python_bindings --find-links dist/ | |
python -c 'import scalpel; print(scalpel.Packet.from_bytes_py(bytes.fromhex("000573a007d168a3c4f949f686dd600000000020064020010470e5bfdead49572174e82c48872607f8b0400c0c03000000000000001af9c7001903a088300000000080022000da4700000204058c0103030801010402"), 1).as_json())' | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Run wasm-pack tests in firefox | |
run: wasm-pack test --firefox --headless --features wasm | |
- name: Run wasm-pack tests in chrome | |
run: wasm-pack test --chrome --headless --features wasm | |
- name: Run wasm-pack tests in node | |
run: wasm-pack test --node --features wasm | |
- name: Build and test with sculpting feature enabled | |
run: cargo build --features sculpting && cargo test --features sculpting |