Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use just and build release on ci #5

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: extractions/setup-just@v1

- name: Login to Docker Hub
run: |
docker login \
-u ${{ secrets.DOCKER_USERNAME }} \
-p ${{ secrets.DOCKER_PASSWORD }}

- name: Download CSVs
run: make download
run: just download

- name: Build Docker image
run: docker build -t extrawurst/ip2country:latest -f Dockerfile .
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: extractions/setup-just@v1

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: check
run: make check
run: just check

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

- name: benchmark-iai
run: |
sudo apt-get update -y && sudo apt-get install -y valgrind
cd ip2country-bench && make bench-inside-docker
cd ip2country-bench && just bench-inside-docker

- name: benchmark
run: cargo bench
26 changes: 0 additions & 26 deletions Makefile

This file was deleted.

File renamed without changes.
28 changes: 28 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BASE_URL:="https://cdn.jsdelivr.net/npm/@ip-location-db/geo-whois-asn-country"
IP4_FILE:="geo-whois-asn-country-ipv4-num.csv"
IP6_FILE:="geo-whois-asn-country-ipv6-num.csv"

download:
curl "{{BASE_URL}}/{{IP4_FILE}}" > ip2country-service/{{IP4_FILE}}
curl "{{BASE_URL}}/{{IP6_FILE}}" > ip2country-service/{{IP6_FILE}}
cp ip2country-service/{{IP4_FILE}} ip2country-grpc/{{IP4_FILE}}
cp ip2country-service/{{IP6_FILE}} ip2country-grpc/{{IP6_FILE}}

docker-local:
docker build -t extrawurst/ip2country:latest -f Dockerfile.local .

docker-local-grpc:
docker build -t extrawurst/ip2country-grpc:latest -f Dockerfile.grpc.local .

docker-run:
docker run -it -p 5000:5000 extrawurst/ip2country:latest

test:
# run this once the container runs locally (see above)
xh 0.0.0.0:5000/172.217.16.78

build:
cargo build -p ip2country-service --release

check:
cargo clippy --workspace
Loading