Issue/50/ephemeris generation #181
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| fmt: | |
| name: Check formatting | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust with rustfmt | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run cargo fmt | |
| run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy lint (${{ matrix.features }}) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| strategy: | |
| matrix: | |
| features: [default, parallel] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust with clippy | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }} | |
| - name: check version | |
| run: | | |
| rustc --version | |
| cargo clippy --version | |
| - name: Run cargo clippy | |
| run: | | |
| if [ "${{ matrix.features }}" = "default" ]; then | |
| cargo clippy --all-targets -- -D warnings | |
| else | |
| cargo clippy --all-targets --features ${{ matrix.features }} -- -D warnings | |
| fi | |
| semver-pr: | |
| name: SemVer (PR vs base) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check semver (baseline = crates.io) | |
| uses: obi1kenobi/cargo-semver-checks-action@v2 | |
| coverage: | |
| name: Coverage (${{ matrix.features }}) | |
| runs-on: ubuntu-latest | |
| needs: [fmt, clippy, semver-pr] | |
| if: | | |
| always() && | |
| (needs.fmt.result == 'success' || needs.fmt.result == 'skipped') && | |
| (needs.clippy.result == 'success' || needs.clippy.result == 'skipped') && | |
| (needs.semver-pr.result == 'success' || needs.semver-pr.result == 'skipped') | |
| strategy: | |
| matrix: | |
| features: [default, parallel] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust stable + llvm-tools | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-llvmcov-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install cargo-llvm-cov | |
| run: cargo install cargo-llvm-cov | |
| - name: Clean coverage artifacts | |
| run: cargo llvm-cov clean --workspace | |
| - name: Generate coverage (lcov) | |
| run: | | |
| if [ "${{ matrix.features }}" = "default" ]; then | |
| cargo llvm-cov \ | |
| --workspace \ | |
| --lcov --output-path lcov.info | |
| else | |
| cargo llvm-cov \ | |
| --workspace \ | |
| --features ${{ matrix.features }} \ | |
| --lcov --output-path lcov.info | |
| fi | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: lcov.info | |
| flags: ${{ matrix.features }} | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |