Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Aug 1, 2023
1 parent 146eba8 commit 9388c4a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 55 deletions.
2 changes: 0 additions & 2 deletions .github/actions-rs/grcov.yml

This file was deleted.

15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
42 changes: 6 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
permissions:
contents: write
deployments: write
actions: read

jobs:
build:
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
6 changes: 3 additions & 3 deletions benches/finders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 9388c4a

Please sign in to comment.