Skip to content

Commit 968f103

Browse files
ci: add Rust lint/test workflows, pin MSRV, and refresh README badges (#304)
* ci: updating binaries for homebrew * ci: initial rust linting and testing actions * docs: updating text
1 parent 8b4d4c3 commit 968f103

6 files changed

Lines changed: 84 additions & 8 deletions

File tree

.github/workflows/rust_lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Rust Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
paths:
7+
- 'services/**'
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
jobs:
14+
clippy:
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: services
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v6
23+
24+
- name: Set up Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
with:
27+
components: clippy, rustfmt
28+
29+
- name: Format
30+
run: cargo fmt --all --check
31+
32+
- name: Lint
33+
run: cargo clippy --all-targets --all-features -- -D warnings

.github/workflows/rust_test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Rust Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
paths:
7+
- 'services/**'
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-22.04
12+
defaults:
13+
run:
14+
working-directory: services
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Set up Rust
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
- name: Run tests
24+
run: cargo test

.goreleaser.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ changelog:
6767
homebrew_casks:
6868
- name: poke-cli
6969
ids: [ poke-cli ]
70+
binaries:
71+
- poke-cli
72+
- poke-cache
7073
description: "A hybrid CLI/TUI tool written in Go for viewing Pokémon data from the terminal!"
7174
homepage: "https://docs.poke-cli.com/"
7275
license: MIT

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,27 @@
22
<img width="425" src="poke-cli.png" alt="pokemon-logo"/>
33
<h4></h4>
44
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
5+
<img src="https://img.shields.io/github/downloads/digitalghost-dev/poke-cli/total?style=flat-square&logo=github&logoColor=FFCC00&label=Downloads&labelColor=EEE&color=FFCC00" alt="downloads">
56
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v2.0.0?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
6-
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
7+
<img src="https://img.shields.io/docker/pulls/digitalghostdev/poke-cli?style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-pulls">
8+
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/release.yml?style=flat-square&logo=github&logoColor=FFCC00&label=Release&labelColor=EEE&color=FFCC00" alt="release-status-badge">
79
</div>
8-
<div align="center">
10+
11+
## Pokemon CLI
12+
<div>
913
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/go_test.yml?style=flat-square&logo=go&logoColor=00ADD8&label=Tests&labelColor=EEE&color=00ADD8" alt="tests-label">
1014
<img src="https://img.shields.io/github/go-mod/go-version/digitalghost-dev/poke-cli?style=flat-square&logo=Go&labelColor=EEE&color=00ADD8" alt="go-version"/>
1115
<img src="https://img.shields.io/codecov/c/github/digitalghost-dev/poke-cli?token=05GBSAOQIT&style=flat-square&logo=codecov&logoColor=00ADD8&labelColor=EEE&color=00ADD8" alt="codecov"/>
1216
</div>
1317

14-
## Pokemon CLI
18+
<div>
19+
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/python_test.yml?style=flat-square&logo=python&logoColor=3776AB&label=Tests&labelColor=EEE&color=3776AB" alt="python-tests-label">
20+
<img src="https://img.shields.io/badge/dynamic/toml?url=https://raw.githubusercontent.com/digitalghost-dev/poke-cli/main/data_platform/pyproject.toml&query=%24.project%5B%27requires-python%27%5D&style=flat-square&logo=python&logoColor=3776AB&label=Python&labelColor=EEE&color=3776AB" alt="python-version"/>
21+
</div>
22+
<div>
23+
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/rust_test.yml?style=flat-square&logo=rust&logoColor=D34516&label=Tests&labelColor=EEE&color=D34516" alt="rust-tests-label">
24+
<img src="https://img.shields.io/badge/dynamic/toml?url=https://raw.githubusercontent.com/digitalghost-dev/poke-cli/main/services/Cargo.toml&query=%24.package%5B%27rust-version%27%5D&style=flat-square&logo=rust&logoColor=D34516&label=Rust&labelColor=EEE&color=D34516" alt="rust-version"/>
25+
</div>
1526
`poke-cli` is a hybrid of a classic CLI and a modern TUI tool for viewing VG and TCG data about Pokémon!
1627

1728
View the [documentation](https://docs.poke-cli.com) on the data infrastructure in [data_platform/](https://github.com/digitalghost-dev/poke-cli/tree/main/data_platform) if you're interested.
@@ -49,16 +60,20 @@ View the [documentation](https://docs.poke-cli.com) on the data infrastructure i
4960

5061

5162
### Homebrew
63+
Homebrew will install the CLI _and_ the Rust caching binary
64+
5265
1. Install the Cask:
5366
```bash
5467
brew install --cask digitalghost-dev/tap/poke-cli
55-
````
68+
```
5669
2. Verify installation:
5770
```bash
58-
poke-cli -v
71+
poke-cli
5972
```
6073

6174
### Scoop
75+
Scoop will install the CLI _and_ the Rust caching binary
76+
6277
1. Add the bucket:
6378
```bash
6479
scoop bucket add digitalghost https://github.com/digitalghost-dev/scoop-bucket.git
@@ -71,7 +86,7 @@ View the [documentation](https://docs.poke-cli.com) on the data infrastructure i
7186

7287
3. Verify installation:
7388
```bash
74-
poke-cli -v
89+
poke-cli
7590
```
7691

7792
### Linux Packages
@@ -85,7 +100,6 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
85100

86101
| Package Type | Distributions | Repository Setup | Installation Command |
87102
|:------------:|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
88-
| `apk` | Alpine | `sudo apk add --no-cache bash && curl -1sLf 'https://dl.cloudsmith.io/basic/digitalghost-dev/poke-cli/setup.alpine.sh' \| sudo -E bash` | `sudo apk add poke-cli --update-cache` |
89103
| `deb` | Ubuntu, Debian | `curl -1sLf 'https://dl.cloudsmith.io/public/digitalghost-dev/poke-cli/setup.deb.sh' \| sudo -E bash` | `sudo apt-get install poke-cli` |
90104
| `rpm` | Fedora, CentOS, Red Hat, openSUSE | `curl -1sLf 'https://dl.cloudsmith.io/public/digitalghost-dev/poke-cli/setup.rpm.sh' \| sudo -E bash` | `sudo yum install poke-cli` |
91105

services/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "services"
33
version = "0.1.0"
44
edition = "2024"
5+
rust-version = "1.86"
56

67
[dependencies]
78
anyhow = "1.0"

services/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ These currently include:
66

77
* Caching
88
* Caches data from APIs to improve performance and reduce network usage.
9+
![Rust caching service sequence diagram](https://dc8hq8aq7pr04.cloudfront.net/rust-caching-service.png)
910

1011
* Aggregation
1112
* Fetches each PokéAPI resource once and returns one structured JSON profile for the Go CLI to render.
12-
![aggregation service squence diagram](https://dc8hq8aq7pr04.cloudfront.net/rust_aggregation_service.png)
13+
![Rust aggregation service sequence diagram](https://dc8hq8aq7pr04.cloudfront.net/rust-aggregation-service.png)
1314

0 commit comments

Comments
 (0)