diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..2a357c0 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: [NLnetLabs] +custom: ['https://nlnetlabs.nl/funding/'] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4127da1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: ci +on: [push, pull_request] +jobs: + test: + name: test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + rust: [1.71, stable, beta] + steps: + - name: Checkout repository + uses: actions/checkout@v1 + - name: Install Rust + uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.rust }} + + # Clippy. + # + # We run Clippy for stable and beta only, to minimize the possibility of a + # lint requiring something in the MSRV but the opposite thing in stable, + # or vice versa. + # + # For stable, error out on warnings. + - if: matrix.rust == 'stable' + run: | + rustup component add clippy + cargo clippy --all --all-features -- -D warnings -W clippy::cargo + + - if: matrix.rust == 'beta' + run: rustup component add clippy + + # For beta, turn warnings into GitHub annotations. + - if: matrix.rust == 'beta' + uses: mathiasvr/command-output@v2.0.0 + id: clippy_beta + with: + run: | + # We can warn on additional lints. cargo::nursery might make sense. + # XXX currently this only shows the first line of output. Also see + # https://github.com/actions/toolkit/issues/193 + # Replacing '\n' with "%0A" might be a workaround. + cargo clippy --all --all-features -q --message-format short -- \ + -W clippy::cargo # -W clippy::nursery + + - if: ${{ steps.clippy_beta.outputs.stderr }} + env: + clippy_warnings: ${{ steps.clippy_beta.outputs.stderr }} + run: echo "::warning ::$clippy_warnings" + + + # Because of all the features, we run build and test twice -- once with + # full features and once without any features at all -- to make it more + # likely that everything works. + + # Build + - run: cargo build --verbose --all --all-features + - run: cargo build --verbose --all + + # Test + - run: cargo test --verbose --all --all-features + - run: cargo test --verbose --all + + # Test using minimal dependency versions from Cargo.toml + - if: matrix.rust != 'beta' + run: | + rustup toolchain install nightly + cargo +nightly update -Z minimal-versions + cargo build --verbose --all --all-features + cargo test --verbose --all --all-features + name: Check and test with minimal-versions diff --git a/Cargo.toml b/Cargo.toml index d41ef1a..0cc886a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "inetnum" -version = "0.1.0-dev" +version = "0.1.0" authors = ["NLnet Labs "] categories = ["network-programming"] description = "Types for IP address prefixes and ASNs." @@ -14,7 +14,7 @@ license = "BSD-3-Clause" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -arbitrary = { version = "1", optional = true, features = ["derive"] } +arbitrary = { version = "1.3", optional = true, features = ["derive"] } serde = { version = "1.0.165", optional = true, features = ["derive"] } [dev-dependencies] diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..16bceb0 --- /dev/null +++ b/Changelog.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 + +Released 2024-03-21. + +Initial release. +