Skip to content

chore: fix clippy issue #1156

chore: fix clippy issue

chore: fix clippy issue #1156

Workflow file for this run

name: CI-Linux
on: [push, pull_request, merge_group]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: docs - stable - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with: { persist-credentials: false }
- name: Install dependencies
shell: bash
run: |
rustc --version
cargo --version
sudo apt-get update
sudo apt-get install -y libgdal-dev libgeos-dev
- name: Format Check
shell: bash
run: cargo fmt --all -- --check
- name: Clippy Check
shell: bash
run: cargo clippy --workspace --all-features --bins --examples --tests --benches -- -D warnings
- name: Test Doc Build
shell: bash
# Make sure this list matches the members list in Cargo.toml
run: |
for package in geozero geozero-cli geozero-bench; do
(echo "----- Testing doc build for package $package ----" && cargo doc -p $package --all-features --no-deps)
done
env:
RUSTDOCFLAGS: "-D warnings"
test:
name: tests - stable - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install dependencies
shell: bash
run: |
rustc --version
cargo --version
sudo apt-get update
sudo apt-get install -y libgdal-dev libgeos-dev
- name: Install protoc
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
- name: Tests
shell: bash
run: |
cargo test -p geozero
cargo test -p geozero --no-default-features
cargo test --workspace --all-features
- name: Set up PostgreSQL with PostGIS
uses: nyurik/action-setup-postgis@b10c6d8544c44e56c00b46174b0b580699a86620 # v1
with:
username: ci
password: ci
database: test
rights: --superuser
port: 34837
id: pg
- name: PostGIS tests
shell: bash
run: |
psql -P pager=off -v ON_ERROR_STOP=1 -f geozero/tests/data/postgis.sql $DATABASE_URL
cargo test -p geozero --all-features -- --ignored postgis --test-threads 1
env:
DATABASE_URL: "${{ steps.pg.outputs.connection-uri }}?sslmode=disable"
# This final step is needed to mark the whole workflow as successful
# Don't change its name - it is used by the merge protection rules
done:
name: stable - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
needs: [ lint, test ]
if: always()
permissions: {}
steps:
- name: Result of the needed steps
run: echo "${{ toJSON(needs) }}"
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
name: CI Result
run: exit 1