Commit Graph

19 Commits

Author SHA1 Message Date
Martin Habovstiak 5c15ed5441
CI: Epic overhaul
Re-write the whole CI pipeline.

Co-developed-by: Martin Habovstiak <martin.habovstiak@gmail.com>
2024-02-02 05:57:23 +11:00
Tobin C. Harding 1c4614ea30
hashes: Remove serde-std feature
We do not need to enable the "std" feature on `serde`.
2024-01-24 12:58:02 +11:00
Matt Corallo add371d263 Remove `core2` dependency entirely 2023-11-09 16:46:44 +00:00
Tobin C. Harding 685e5101ce
Add wasm dev-deps using CI script
We only test WASM in CI using a stable toolchain however because we have
a target specific dev-dependencies section the wasm deps get pulled in
during MSRV builds - this breaks the MSRV build.

Instead of including WASM dev-dependencies in the manifest we can
dynamically modify the manifest when running the WASM tests. We do this
already to add the `crate-type` section so this is not really that
surprising to see in the CI script.

Doing so allows us to stop pinning the transitive `syn` dependency also
which is included in the dependency graph because of `wasm-bingen-test`.
2023-10-05 11:16:24 +11:00
Tobin C. Harding c3a99c62ad
CI: Pin serde_json for MSRV build
Recent release of `serde_json` depends on `serde` 1.0.66 but we pin to
1.0.56

Pin `serde_json` for MSRV build to v1.0.99
2023-07-12 15:50:18 +10:00
Tobin C. Harding aa7b3a7d0c
ci: Remove stal DO_ALLOC_TESTS variable
We never enable the `DO_ALLOC_TESTS` variable, and hence never test the
"alloc" feature in `hashes`.

Remove the `DO_ALLOC_TESTS` variable and add "alloc" to the `FEATURES`
array.
2023-05-25 18:16:26 +10:00
Martin Habovstiak c4c64c0dc5
Test with minimal dependency versions
It could happen that we unknowingly depend on a new version of a crate
without updating `Cargo.toml`. This could cause resolution issues for
downstream users. It's also unclear for outsiders to see which
dependencies we tested the crate with.

This change commits two lock files: `minimal` and `recent`. `minimal`
contains minimal depdendency versions, while `recent` contains
dependency versions at the time of making the change.

Further, this adds CI jobs to test with both lock files, CI job for
`internals` crate, removes old `serde` pinning and prints a warning if
`recent` is no longer up to date. (We may have to override it somehow if
any crate breaks MSRV.)

The documentation is also updated accordingly.

Co-developed-by: Tobin C. Harding <me@tobin.cc>

Closes #1230
2023-05-03 08:06:46 +10:00
Tobin C. Harding 6c61e1019e
Fix pinning (schemars and MSRV)
Done as is single patch to make sure all the docs and CI are in sync and
correct.

We currently pin the `schemars` dependency using `<=0.8.3` as well as a
the `dyn-clone` transient dependency in the manifest (`hashes` and the
extended test crate). This is incorrect because it makes usage of the
crate klunky (or possibly impossible) if downstream users wish to use a
later version of `schemars`.

Observe also that we do not have to pin `schemars`, we do however have to pin
the `serde` crate if either `serde` or `schemars` features are enabled.
Do so in CI and document in the readme file within hashes.

Currently we have a pin remaining from the old MSRV (`syn` due to use
of `matches!`).

Fix pinning by:

- Remove pin in manifest for `schemars`
- Fix pinning for MSRV in CI and docs (this includes documenting pinning
  requirements for `schemars` feature because it is related to the other
  pin of `serde`) in both `hashes` readme and main repo readme.
2023-04-19 10:17:18 +10:00
Tobin C. Harding c1360067e9
Enable formatting in CI
Enable formatting in CI by doing:

- Add a section to the `test.sh` scripts to run the formatter (guarded by
  the env variable `DO_FMT`) for all crates (bitcoin, hashes, internals).
- Add `DO_FMT` to the nightly `Tests` CI job.
2023-03-07 08:57:32 +11:00
Andrew Poelstra 794ddde657
Merge rust-bitcoin/rust-bitcoin#1569: ci: Remove incorrect code comment and cargo clean
70bff0de8d ci: Remove incorrect code comment and cargo clean (Tobin C. Harding)

Pull request description:

  Recently while trying to fix CI I (Tobin) added a call to `cargo clean` and a code comment justifying it. This was merged because while not incorrect it is redundant since calling `cargo` with different `RUSTFLAGS` triggers a rebuild.

ACKs for top commit:
  apoelstra:
    ACK 70bff0de8d
  Kixunil:
    ACK 70bff0de8d

Tree-SHA512: 5bed107aedf9d6d240fa885335bfe04099436c0d30c045554644b43a06900c415708dfcedbd27037564d296c0ab12e4c4d4dc1e25ab64b4cc07ca7b46c46628a
2023-02-18 01:28:46 +00:00
Andrew Poelstra 9615dd12b8
Merge rust-bitcoin/rust-bitcoin#1505: Improve test coverage for docs build
41f2dcf6ae Improve test coverage for docs build (Tobin C. Harding)
b4c14a4b7c hashes: Use automatic link (Tobin C. Harding)
96e8a080d1 ci: Remove redundant || exit (Tobin C. Harding)

Pull request description:

  Currently the docs build commands in `hashes` and `bitcoin` differ, they should be the same.

  Add a command `cargo doc` to improve coverage e.g., recently we botched the feature guarding but since CI only runs `cargo rustdoc` with custom compiler conditional set we didn't catch it.

  Done after seeing: https://github.com/rust-bitcoin/rust-bitcoin/pull/1504 and CI should fail on this PR until 1504 is in.

ACKs for top commit:
  apoelstra:
    ACK 41f2dcf6ae
  Kixunil:
    ACK 41f2dcf6ae

Tree-SHA512: 7cde68292cfc6f32b75d066e188e7c418ee251f9a5abc57fbd642ba33e9cd5bd8ef7c5ba7cffd206acae6ddec2f8c3db38c8c911a4319e979158666b8225953d
2023-02-10 23:20:57 +00:00
Tobin C. Harding 70bff0de8d
ci: Remove incorrect code comment and cargo clean
Recently while trying to fix CI I (Tobin) added a call to `cargo clean`
and a code comment justifying it. This was merged because while not
incorrect it is redundant since calling `cargo` with different
`RUSTFLAGS` triggers a rebuild.
2023-01-21 09:37:16 +11:00
Tobin C. Harding 53ee42d7c1
Fix ASAN in CI
When we merged `hashes` into `rust-bitcoin` we ran the test script a
couple of times using `./hashes/contrib/test.sh` this causes the `cargo`
commands in the CI script to be run from the crate root which is not
what we want.

This showed up recently because `cargo test` was getting run in
`bitcoin` after building with address/memory sanitazation configured
into the build.

While we are at it run `cargo clean` after the last sanitizer build just
to future proof the CI script in case we later accidentally re-use the same
build with plain old `cargo` (without `-Zbuild-std etc.`).
2023-01-20 15:47:43 +11:00
Tobin C. Harding 41f2dcf6ae
Improve test coverage for docs build
Currently the docs build commands in `hashes` and `bitcoin` differ, they
should be the same.

Add a command `cargo doc` to improve coverage e.g., recently we botched
the feature guarding but since CI only runs `cargo rustdoc` with custom
compiler conditional set we didn't catch it.

Run docs in CI using nightly and stable toolchains as required.
2023-01-16 13:56:56 +11:00
Tobin C. Harding 7593f1f334
Use set -ex
Use the more typical form to enable bash features.

Refactor only, no logic changes.
2023-01-13 07:32:30 +11:00
Andrew Poelstra 249a2cfa2a
Merge rust-bitcoin/rust-bitcoin#1468: hashes: ci: Remove --all
56e4e53357 hashes: ci: Remove --all (Tobin C. Harding)

Pull request description:

  Currently we are using the `--all` flag in `cargo` commands in the `hashes` CI script. This flag (the deprecated version of `--workspace`) causes cargo to run the command for the whole workspace, this is not what we want because we run test individually for each crate using a ci script per crate.

  The effect of this patch is to reduce re-runs of tests i.e., reduce machine usage during CI runs with no reduction of coverage - PROFIT!

ACKs for top commit:
  apoelstra:
    ACK 56e4e53357
  sanket1729:
    utACK 56e4e53357

Tree-SHA512: 13134ba2f6806a705f99af5b8d66b051e1e58da177a02ee46880f494e37c380fc4c28731cd42eabbd69ae884763dbc360902e0e8afa7f88e78483e8a37f614f5
2022-12-30 17:21:39 +00:00
Tobin C. Harding 56e4e53357 hashes: ci: Remove --all
Currently we are using the `--all` flag in `cargo` commands in the
`hashes` CI script. This flag (the deprecated version of `--workspace`)
causes cargo to run the command for the whole workspace, this is not
what we want because we run test individually for each crate using a ci
script per crate.

The effect of this patch is to reduce re-runs of tests i.e., reduce
machine usage during CI runs with no reduction of coverage - PROFIT!
2022-12-14 08:24:59 +11:00
Tobin C. Harding b78ba730f2 hashes: Run clippy in ci
Currently we only run the linter in `bitcoin/contrib/test.sh`, we should
do the same in the `hashes` ci script.
2022-11-30 14:43:56 +11:00
Tobin C. Harding b9643bf3e9 Import bitcoin_hashes crate into hashes
We would like to bring the `bitcoin_hashes` crate into the
`rust-bitcoin` repository.

Import `bitcoin_hashes` into `rust-bitocin/hashes`, doing so looses all
the commit history from the original crate but if we archive the
original repository then the history will be preserved. We maintain the
same version number obviously and in the changelog we note the change of
repository.

Commit hash that was tip of `bitcoin_hashes` at time of import:

 commit 54c16249e06cc6b7870c7fc07d90f489d82647c7

Includes making `embedded` and `fuzzing` per-crate i.e., move them into
`bitcoin` as hashes includes these also.

NOTE: Does _not_ enable fuzzing for `hashes` in CI.

Notes on CI:

Attempts to merge in the github actions from the hashes crate however reduces
coverage by not running hashes tests for beta toolchain. Some additional
work could be done to improve the CI to increase efficiency without
reducing coverage. Leaving for another day.
2022-11-08 08:58:09 +11:00