Skip to content

Commit

Permalink
Merge pull request #357 from YuukiToriyama/release/v0.1.7
Browse files Browse the repository at this point in the history
release/v0.1.7をmainブランチにマージ
  • Loading branch information
YuukiToriyama authored Aug 11, 2024
2 parents fb4a3ed + bc1fb07 commit 47b0c38
Show file tree
Hide file tree
Showing 26 changed files with 685 additions and 373 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/code-check.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/code-quality-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code quality check

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'code-quality'
cache-provider: 'github'
- name: Setup clippy
run: rustup component add clippy
- name: Code review with clippy
uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
filter_mode: 'nofilter'
github_token: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/run-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Unit test & Integration test

on:
pull_request:
push:
branches: [ 'main' ]

env:
CARGO_TERM_COLOR: always

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'test-on-pr'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
- name: Test core
working-directory: core
run: |
cargo test
cargo test --features=blocking
- name: Integration test
working-directory: tests
run: cargo test

run-tests-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
shared-key: 'wasm-pack'
key: 'main'
save-if: ${{ github.ref == 'refs/heads/main' }} # mainブランチにコミットが追加された時のみキャッシュを保存する
cache-provider: 'github'
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Run wasm-pack test for core(japanese-address-parser)
working-directory: core
run: wasm-pack test --firefox --headless
- name: Build check for wasm crate
working-directory: wasm
run: wasm-pack build --target web --scope toriyama
27 changes: 0 additions & 27 deletions .github/workflows/wasm-pack-test.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.5"
version = "0.1.7"
edition = "2021"
description = "A Rust Library to parse japanese addresses."
repository = "https://github.com/YuukiToriyama/japanese-address-parser"
Expand All @@ -18,6 +18,8 @@ keywords = ["parser", "geo", "wasm"]
categories = ["parser-implementations", "wasm"]

[workspace.dependencies]
serde = { version = "1.0.192", features = ["derive"] }
tokio = { version = "1.38.0", features = ["rt", "macros"] }
wasm-bindgen = "0.2.92"
wasm-bindgen-futures = "0.4.42"
wasm-bindgen-test = "0.3.42"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Docs](https://docs.rs/japanese-address-parser/badge.svg)](https://docs.rs/japanese-address-parser)
[![Crates.io (latest)](https://img.shields.io/crates/v/japanese-address-parser)](https://crates.io/crates/japanese-address-parser)
![Rust Version](https://img.shields.io/badge/rust%20version-%3E%3D1.73.0-orange)
[![Unit test & Code check](https://github.com/YuukiToriyama/japanese-address-parser/actions/workflows/code-check.yaml/badge.svg)](https://github.com/YuukiToriyama/japanese-address-parser/actions/workflows/code-check.yaml)
[![Unit test & Integration test](https://github.com/YuukiToriyama/japanese-address-parser/actions/workflows/run-test.yaml/badge.svg?branch=main)](https://github.com/YuukiToriyama/japanese-address-parser/actions/workflows/run-test.yaml)

A Rust Library to parse japanese addresses.

Expand Down
11 changes: 7 additions & 4 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ crate-type = ["rlib", "cdylib"]

[features]
default = []
blocking = []
blocking = ["reqwest/blocking"]

[dependencies]
itertools = "0.13.0"
js-sys = "0.3.67"
nom = "7.1.3"
rapidfuzz = "0.5.0"
regex = "1.10.2"
reqwest = { version = "0.12.3", default-features = false, features = ["json", "rustls-tls", "blocking"] }
serde = { version = "1.0.192", features = ["derive"] }
serde.workspace = true
reqwest = { version = "0.12.5", default-features = false, features = ["json", "rustls-tls"] }

[dev-dependencies]
tokio = { version = "1.38.0", features = ["rt", "macros"] }
tokio.workspace = true
wasm-bindgen-test = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
mockito = "1.4.0" # mockitoがwasm32に対応していないため
12 changes: 6 additions & 6 deletions core/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pub mod city_master_api;
pub mod prefecture_master_api;
pub use crate::repository::geolonia::city_master_api;
pub use crate::repository::geolonia::prefecture_master_api;

use crate::api::city_master_api::CityMasterApi;
use crate::api::prefecture_master_api::PrefectureMasterApi;
use crate::entity::{City, Prefecture};
use crate::err::Error;
use crate::domain::geolonia::entity::{City, Prefecture};
use crate::domain::geolonia::error::Error;
use crate::repository::geolonia::city_master_api::CityMasterApi;
use crate::repository::geolonia::prefecture_master_api::PrefectureMasterApi;

#[derive(Default)]
pub struct AsyncApi {
Expand Down
1 change: 1 addition & 0 deletions core/src/domain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod geolonia;
2 changes: 2 additions & 0 deletions core/src/domain/geolonia.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod entity;
pub mod error;
Loading

0 comments on commit 47b0c38

Please sign in to comment.