fix: data-to-be-packed resize remove existing values (#30) #151
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: taiki-e/install-action@v2 | |
with: { tool: 'just,cargo-llvm-cov' } | |
- uses: actions/checkout@v4 | |
with: { submodules: recursive } | |
- if: github.event_name == 'release' | |
name: Ensure this crate has not yet been published (on release) | |
run: just check-if-published | |
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
uses: Swatinem/rust-cache@v2 | |
- run: RUST_BACKTRACE=1 just -v ci-test | |
- name: Check semver | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | |
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
name: Generate code coverage | |
run: just ci-coverage | |
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: target/llvm-cov/codecov.info | |
fail_ci_if_error: false | |
- name: Test packaging for publish | |
run: | | |
rustup install nightly --profile minimal | |
just test-publish | |
msrv: | |
name: Test MSRV | |
runs-on: ubuntu-latest | |
steps: | |
- uses: taiki-e/install-action@v2 | |
with: { tool: just } | |
- uses: actions/checkout@v4 | |
with: { submodules: recursive } | |
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
uses: Swatinem/rust-cache@v2 | |
- name: Read MSRV | |
id: msrv | |
run: echo "value=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT | |
- name: Install MSRV Rust ${{ steps.msrv.outputs.value }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ steps.msrv.outputs.value }} | |
components: rustfmt | |
- run: just -v ci-test-msrv | |
publish: | |
if: startsWith(github.ref, 'refs/tags/') | |
name: Publish to crates.io | |
needs: [ test, msrv ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Publish to crates.io | |
run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |