diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml deleted file mode 100644 index 2ef4c15..0000000 --- a/.github/actions-rs/grcov.yml +++ /dev/null @@ -1,2 +0,0 @@ -output-type: lcov -output-file: ./lcov.info diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b486dd3..3f58e9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,23 +14,12 @@ env: jobs: publish: runs-on: ubuntu-latest - env: - PROTOC_VERSION: "3.20.3" if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/checkout@v3 - - name: Setup | Rust - uses: ATiltedTree/setup-rust@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - rust-version: nightly - - name: Install protoc - run: | - curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip - sudo unzip -o protoc-$PROTOC_VERSION-linux-x86_64.zip -d /usr/local bin/protoc - sudo unzip -o protoc-$PROTOC_VERSION-linux-x86_64.zip -d /usr/local 'include/*' - rm -f protoc-$PROTOC_VERSION-linux-x86_64.zip - - name: Cache - uses: Swatinem/rust-cache@v2 + toolchain: nightly - uses: katyo/publish-crates@v2 with: registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cf51814..cbedd64 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,7 +12,6 @@ env: permissions: contents: write deployments: write - actions: read jobs: build: @@ -23,48 +22,19 @@ jobs: with: comment_on_pr: false - uses: actions/checkout@v3 - - name: Setup | Rust - uses: ATiltedTree/setup-rust@v1 + + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - rust-version: nightly - - name: Cache - uses: Swatinem/rust-cache@v2 + toolchain: nightly + - name: Build - run: cargo build --verbose + run: cargo build - name: Run tests - run: cargo test --verbose - env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" - RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" - - name: rust-grcov - uses: actions-rs/grcov@v0.1.6 - - name: Codecov - uses: codecov/codecov-action@v3.1.4 - with: - # Repository upload token - get it from codecov.io. Required only for private repositories - # token: # optional - # Specify whether the Codecov output should be verbose - verbose: true - fail_ci_if_error: true + run: cargo test - name: Run benches run: cargo bench - # - name: Continuous Benchmark - # uses: benchmark-action/github-action-benchmark@v1.15.0 - # if: ${{ github.ref == 'refs/heads/main' }} - # with: - # name: Go Benchmark - # tool: "cargo" - # output-file-path: output.txt - # github-token: ${{ secrets.CI_TOKEN }} - # gh-repository: "github.com/ringsaturn/tzf-rs" - # auto-push: true - # comment-on-alert: true - # fail-on-alert: false - # benchmark-data-dir-path: "docs/" - - name: Upload artifact uses: actions/upload-artifact@v3 with: diff --git a/Cargo.toml b/Cargo.toml index 6717499..2be01d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" homepage = "http://github.com/ringsaturn/tzf-rs" keywords = ["timezone", "geo"] license-file = "LICENSE" +license = "MIT" name = "tzf-rs" readme = "README.md" repository = "http://github.com/ringsaturn/tzf-rs" diff --git a/README.md b/README.md index e2de9a7..bb6210b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# tzf-rs: a fast timezone finder for Rust. [![Rust](https://github.com/ringsaturn/tzf-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/ringsaturn/tzf-rs/actions/workflows/rust.yml) [![Documentation](https://docs.rs/tzf-rs/badge.svg)](https://docs.rs/tzf-rs) [![codecov](https://codecov.io/gh/ringsaturn/tzf-rs/branch/main/graph/badge.svg?token=NQFIP9DD86)](https://codecov.io/gh/ringsaturn/tzf-rs) +# tzf-rs: a fast timezone finder for Rust. [![Rust](https://github.com/ringsaturn/tzf-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/ringsaturn/tzf-rs/actions/workflows/rust.yml) [![Documentation](https://docs.rs/tzf-rs/badge.svg)](https://docs.rs/tzf-rs) ![](https://github.com/ringsaturn/tzf/blob/gh-pages/docs/tzf-social-media.png?raw=true) diff --git a/benches/finders.rs b/benches/finders.rs index dfe08a9..9794a49 100644 --- a/benches/finders.rs +++ b/benches/finders.rs @@ -5,13 +5,13 @@ use rand::seq::SliceRandom; use tzf_rs::{DefaultFinder, Finder}; lazy_static! { - static ref DEFAULTFINDER: DefaultFinder = DefaultFinder::new(); + static ref DEFAULT_FINDER: DefaultFinder = DefaultFinder::new(); static ref FINDER: Finder = Finder::new(); } fn bench_default_finder_random_city(_i: usize) { let city = CITIES.choose(&mut rand::thread_rng()).unwrap(); - let _ = DEFAULTFINDER.get_tz_name(city.lng, city.lat); + let _ = DEFAULT_FINDER.get_tz_name(city.lng, city.lat); } fn bench_finder_random_city(_i: usize) { @@ -23,7 +23,7 @@ fn bench_finders(c: &mut Criterion) { let mut group = c.benchmark_group("Finders"); // warmup - let _ = DEFAULTFINDER.get_tz_name(116.3883, 39.9289); + let _ = DEFAULT_FINDER.get_tz_name(116.3883, 39.9289); let _ = FINDER.get_tz_name(116.3883, 39.9289); let i = &0;