name: Rust
on:
push:
branches: [ "main" ]
tags:
- "*"
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install python
run: pip install pytest
- name: Build
run: cargo build
- name: Build (all features)
run: cargo build --all-features
- name: Build (STD)
run: cargo build --features std
- name: Build (SBAS)
run: cargo build --features sbas
- name: Build (DOMES)
run: cargo build --features domes
- name: Build (COSPAR)
run: cargo build --features cospar
- name: Build (Python)
run: cargo build --features python
- name: Tests
run: cargo test --features full
- name: Coding style
run: cargo fmt --all -- --check
- name: Documentation
run: cargo doc --all-features
- name: Python dependencies
continue-on-error: true
run: sudo apt-get update -y && sudo apt-get install -y libssl-dev openssl pkg-config
- name: Install pytest
continue-on-error: true
run: pip install pytest
- name: Install maturin
continue-on-error: true
run: cargo install maturin
- name: Install library
continue-on-error: true
run: maturin develop --all-features
- name: Run pytest
continue-on-error: true
run: pytest
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
if: github.ref_type == 'tag'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Publish
env:
TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
cargo login $TOKEN
cargo publish