diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5dfc3a7..7490f3f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,6 @@ --- name: CI -"on": +on: pull_request: push: branches: @@ -8,8 +8,36 @@ name: CI schedule: - cron: "0 16 * * 1" # 8am PST every Monday jobs: - ci: - name: Format, lint, and test + lint: + name: Lints + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install rust + run: | + rustup -V + rustup set profile minimal + rustup toolchain install stable + rustup show + + - name: Check Formatting + run: cargo fmt --check --all --verbose + + - name: Clippy + run: cargo clippy --workspace --all-features --verbose -- -Dwarnings + + # Check for docs warnings + # Only do this for the swiftnav crate since swiftnav-sys has some errors + # in the bindgen output + - name: Docs + env: + RUSTDOCFLAGS: -D warnings + run: cargo doc --package swiftnav --all-features --no-deps --verbose + + build: + name: Build and test runs-on: ${{ matrix.os }} strategy: matrix: @@ -19,25 +47,18 @@ jobs: binary_target: x86_64-unknown-linux-musl needs_musl: true toolchain: stable - - os: ubuntu-20.04 - binary_target: x86_64-unknown-linux-gnu - toolchain: stable - # MacOS ARM - os: macos-latest binary_target: aarch64-apple-darwin toolchain: stable - # Windows - os: windows-latest binary_target: x86_64-pc-windows-msvc toolchain: stable - # Nightly Rust - os: ubuntu-latest binary_target: x86_64-unknown-linux-gnu toolchain: nightly - # MSRV - os: ubuntu-latest binary_target: x86_64-unknown-linux-gnu @@ -46,7 +67,6 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: davidB/rust-cargo-make@v1 - name: Install musl tools if: matrix.needs_musl @@ -77,4 +97,7 @@ jobs: rustup show - name: Build - run: cargo make --no-workspace workspace-ci-flow + run: cargo build --workspace --all-features --verbose + + - name: Test + run: cargo test --workspace --all-features --verbose diff --git a/Makefile.toml b/Makefile.toml deleted file mode 100644 index 30155f2..0000000 --- a/Makefile.toml +++ /dev/null @@ -1,26 +0,0 @@ -[env] -CARGO_MAKE_RELEASE_FLOW_TARGET = "${{ matrix.binary_target }}" -CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true -CARGO_MAKE_RUN_CLIPPY = true -CARGO_MAKE_CLIPPY_ARGS = "--all-features -- -D warnings" -CARGO_MAKE_RUN_CHECK_FORMAT = true -CARGO_MAKE_CARGO_VERBOSE_FLAGS = "-vv" -RUSTFLAGS="-D warnings" - -[tasks.check-format-ci-flow] -condition = { env_set = [ - "CARGO_MAKE_RUN_CHECK_FORMAT", -], channels = [ - "stable", -], platforms = [ - "linux", -] } - -[tasks.clippy-ci-flow] -condition = { env_set = [ - "CARGO_MAKE_RUN_CLIPPY", -], channels = [ - "stable", -], platforms = [ - "linux", -] } diff --git a/swiftnav/src/coords.rs b/swiftnav/src/coords.rs index c37e403..e0c7906 100644 --- a/swiftnav/src/coords.rs +++ b/swiftnav/src/coords.rs @@ -41,11 +41,11 @@ //! the more common algortihms based on the Newton-Raphson method. //! //! # References -//! * "A comparison of methods used in rectangular to Geodetic Coordinates -//! Transformations", Burtch R. R. (2006), American Congress for Surveying -//! and Mapping Annual Conference. Orlando, Florida. -//! * "Transformation from Cartesian to Geodetic Coordinates Accelerated by -//! Halley’s Method", T. Fukushima (2006), Journal of Geodesy. +//! * "A comparison of methods used in rectangular to Geodetic Coordinates +//! Transformations", Burtch R. R. (2006), American Congress for Surveying +//! and Mapping Annual Conference. Orlando, Florida. +//! * "Transformation from Cartesian to Geodetic Coordinates Accelerated by +//! Halley’s Method", T. Fukushima (2006), Journal of Geodesy. use std::ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign}; diff --git a/swiftnav/src/reference_frame/mod.rs b/swiftnav/src/reference_frame/mod.rs index e771dea..b9a7c11 100644 --- a/swiftnav/src/reference_frame/mod.rs +++ b/swiftnav/src/reference_frame/mod.rs @@ -36,14 +36,14 @@ //! This module provides several types and functions to help transform a set of coordinates //! from one reference frame to another, and from one epoch to another. Several sets of //! transformation parameters are included for converting between common reference frames. -//! To start out, you must have a [`Coordinate`](crate::coords::Coordinate) that you want to -//! transform. This consists of a position, an epoch, and a reference frame as well as an optional -//! velocity. You then need to get the [`Transformation`](crate::reference_frame::Transformation) -//! object that describes the transformation from the reference frame of the coordinate to the -//! desired reference frame. You can then call the `transform` method on the transformation object -//! to get a new coordinate in the desired reference frame. This transformation will change the -//! position and velocity of the coordinate, but it does not the change the epoch of the coordinate. -//! If you need to change the epoch of the coordinate you will need to use the [`Coordinate::adjust_epoch`](crate::coords::Coordinate::adjust_epoch) +//! To start out, you must have a [`Coordinate`] that you want to transform. This consists of a +//! position, an epoch, and a reference frame as well as an optional velocity. You then need to +//! get the [`Transformation`] object that describes the transformation from the reference +//! frame of the coordinate to the desired reference frame. You can then call the `transform` +//! method on the transformation object to get a new coordinate in the desired reference frame. +//! This transformation will change the position and velocity of the coordinate, but it does +//! not the change the epoch of the coordinate. If you need to change the epoch of the +//! coordinate you will need to use the [`Coordinate::adjust_epoch`](crate::coords::Coordinate::adjust_epoch) //! method which uses the velocity of the coordinate to determine the position at the new epoch. //! //! # Example @@ -304,7 +304,7 @@ pub fn get_transformation( /// A helper type for finding transformations between reference frames that require multiple steps /// -/// This object can be used to determine which calls to [`get_transformation`](crate::reference_frame::get_transformation) +/// This object can be used to determine which calls to [`get_transformation`] /// are needed when a single transformation does not exist between two reference frames. pub struct TransformationGraph { graph: HashMap>, diff --git a/swiftnav/src/troposphere.rs b/swiftnav/src/troposphere.rs index 9070e78..cc91220 100644 --- a/swiftnav/src/troposphere.rs +++ b/swiftnav/src/troposphere.rs @@ -13,8 +13,8 @@ //! parameters are hardcoded into the library, unlike the ionosphere model. //! //! # References -//! * UNB Neutral Atmosphere Models: Development and Performance. R Leandro, -//! M Santos, and R B Langley +//! * UNB Neutral Atmosphere Models: Development and Performance. R Leandro, +//! M Santos, and R B Langley /// Calculate tropospheric delay using UNM3m model. ///