-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (39 loc) · 1.23 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Run CI checks
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tooling
run: |
cargo install cargo-audit
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Package Audit
run: |
mkdir -p ~/.cargo
cp .cargo/audit.toml ~/.cargo/audit.toml
cargo audit
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download GeoDB
env:
GEOLITE_API_KEY: ${{ secrets.GEOLITE_API_KEY }}
run: |
echo "::add-mask::${GEOLITE_API_KEY}"
if [ "${GEOLITE_API_KEY}" == "" ]; then
echo "GEOLITE_API_KEY env var required"
exit 1
fi
URL="https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${GEOLITE_API_KEY}&suffix=tar.gz"
curl -L "$URL" --output geolite.tar.gz
tar --strip-components=1 --wildcards -zxvf geolite.tar.gz -- '*/GeoLite2-Country.mmdb'
- name: Build
run: cargo build --release
- name: Test
run: cargo test --release