erikjara / rut-lib

A Rust library for parsing, format and validate a Chilean ID (RUT)
MIT License
4 stars 3 forks source link

CI | Publish to Crates.io #1

Closed EstebanBorai closed 4 years ago

EstebanBorai commented 4 years ago

Based on https://github.com/erikjara/rut-lib/projects/3#card-31422108 .

I've added a "first step" for CI/CD with GitHub Actions through a workflow that:

  1. Builds the crate for every target (linux, macos and windows)
  2. Stores each artifact for future download from Actions Artifacts
  3. Creates GitHub Release
  4. Publish the release to Crates.io

Further Steps to get this working

Suggestions

I would also setup a CI workflow to format, lint and test your crate before releasing!

Hope this helps!

EstebanBorai commented 4 years ago

Hey @erikjara any news on this PR?

erikjara commented 4 years ago

@EstebanBorai Hi! Let me fix those warnings, create the coverage config and I'll merge your changes :)

$ cargo clippy -- -D warnings
    Updating crates.io index
    Checking rut-lib v0.1.2 (/home/travis/build/erikjara/rut-lib)
error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
   --> src/lib.rs:299:22
    |
299 |             let dv = captures["dv"].to_uppercase().chars().nth(0).unwrap();
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `captures["dv"].to_uppercase().chars().next()`
    |
    = note: `-D clippy::iter-nth-zero` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
   --> src/lib.rs:313:18
    |
313 |             _ => format!("{}", dv).chars().nth(0).unwrap(),
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `format!("{}", dv).chars().next()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
error: aborting due to 2 previous errors
error: could not compile `rut-lib`.