satkit 0.3.14

Satellite Toolkit
Documentation
name: Build

on:
  push:
    branches:
      - "*"

jobs:
  build:
    name: build and test satkit
    strategy:
      fail-fast: false
      matrix:
        os:
          - macos
          - ubuntu
          - windows
        include:
          - os: ubuntu
            testvec_path: satkit-testvecs
            data_path: astro-data
            platform: linux
          - os: macos
            testvec_path: satkit-testvecs
            data_path: astro-data
          - os: windows
            ls: dir
            testvec_path: satkit-testvecs
            data_path: astro-data

    runs-on: ${{ format('{0}-latest', matrix.os) }}

    env:
      SATKIT_DATA: ${{matrix.data_path}}
      SATKIT_TESTVEC_ROOT: ${{matrix.testvec_path}}

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable


      # Try to recover satkit data from cache
      - name: Cache Satkit Data
        id: cache-satkit-data
        uses: actions/cache@v4
        with:
          path: ${{matrix.data_path}}
          enableCrossOsArchive: True
          key: satkit-data-cache

      # Download data if it is not in the cache
      - name: Download Satkit Data
        if: steps.cache-satkit-data.outputs.cache-hit != 'true'
        run: |
          python -m pip install requests
          python python/test/download_data.py ${{matrix.data_path}}
        

      # Try to recover satkit test vectors from cache
      - name: Cache Satkit Test Vectors
        id: cache-satkit-testvecs
        uses: actions/cache@v4
        with:
          path: ${{matrix.testvec_path}}
          enableCrossOsArchive: True
          key: satkit-testvecs-cache

      # Download test vectors if they are not in the cache
      - name: Download Satkit Test Vectors
        if: steps.cache-satkit-testvecs.outputs.cache-hit != 'true'
        run: |
          python -m pip install requests 
          python python/test/download_testvecs.py ${{matrix.testvec_path}}

      - name: Cargo Cache
        uses: actions/cache@v4
        continue-on-error: false
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            target/            
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: ${{ runner.os }}-cargo-

      - name: Build
        run: cargo build --release
      
      - name: Test
        run: cargo test

      - name: Doc
        run: cargo doc --no-deps