Skip to content

Commit b31c18c

Browse files
authored
use just and build release on ci (#5)
1 parent c3c2270 commit b31c18c

File tree

5 files changed

+37
-31
lines changed

5 files changed

+37
-31
lines changed

.github/workflows/cd.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ jobs:
1111
- name: Checkout
1212
uses: actions/checkout@v4
1313

14+
- uses: extractions/setup-just@v1
15+
1416
- name: Login to Docker Hub
1517
run: |
1618
docker login \
1719
-u ${{ secrets.DOCKER_USERNAME }} \
1820
-p ${{ secrets.DOCKER_PASSWORD }}
1921
2022
- name: Download CSVs
21-
run: make download
23+
run: just download
2224

2325
- name: Build Docker image
2426
run: docker build -t extrawurst/ip2country:latest -f Dockerfile .

.github/workflows/ci.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v4
1414

15+
- uses: extractions/setup-just@v1
16+
1517
- name: Install Protoc
1618
uses: arduino/setup-protoc@v3
1719
with:
1820
repo-token: ${{ secrets.GITHUB_TOKEN }}
1921

2022
- name: check
21-
run: make check
23+
run: just check
2224

23-
- name: Build Docker image
24-
run: docker build -t extrawurst/ip2country:latest -f Dockerfile .
25+
- name: build
26+
run: just build
2527

2628
- name: benchmark-iai
2729
run: |
2830
sudo apt-get update -y && sudo apt-get install -y valgrind
29-
cd ip2country-bench && make bench-inside-docker
31+
cd ip2country-bench && just bench-inside-docker
3032
3133
- name: benchmark
3234
run: cargo bench

Makefile

-26
This file was deleted.
File renamed without changes.

justfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BASE_URL:="https://cdn.jsdelivr.net/npm/@ip-location-db/geo-whois-asn-country"
2+
IP4_FILE:="geo-whois-asn-country-ipv4-num.csv"
3+
IP6_FILE:="geo-whois-asn-country-ipv6-num.csv"
4+
5+
download:
6+
curl "{{BASE_URL}}/{{IP4_FILE}}" > ip2country-service/{{IP4_FILE}}
7+
curl "{{BASE_URL}}/{{IP6_FILE}}" > ip2country-service/{{IP6_FILE}}
8+
cp ip2country-service/{{IP4_FILE}} ip2country-grpc/{{IP4_FILE}}
9+
cp ip2country-service/{{IP6_FILE}} ip2country-grpc/{{IP6_FILE}}
10+
11+
docker-local:
12+
docker build -t extrawurst/ip2country:latest -f Dockerfile.local .
13+
14+
docker-local-grpc:
15+
docker build -t extrawurst/ip2country-grpc:latest -f Dockerfile.grpc.local .
16+
17+
docker-run:
18+
docker run -it -p 5000:5000 extrawurst/ip2country:latest
19+
20+
test:
21+
# run this once the container runs locally (see above)
22+
xh 0.0.0.0:5000/172.217.16.78
23+
24+
build:
25+
cargo build -p ip2country-service --release
26+
27+
check:
28+
cargo clippy --workspace

0 commit comments

Comments
 (0)