-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (66 loc) · 2.4 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Build
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.SHELL }}
env:
CSPICE_DIR: '${{ github.workspace }}/cspice'
CSPICE_URL: ${{ matrix.CSPICE_URL }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
CSPICE_URL: "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Linux_GCC_64bit/packages/cspice.tar.Z"
SHELL: bash
- os: macos-latest
CSPICE_URL: "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z"
SHELL: bash
- os: windows-latest
CSPICE_URL: "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Windows_VisualC_64bit/packages/cspice.zip"
SHELL: powershell
steps:
- uses: actions/checkout@v2
- name: Download CSPICE
if: ${{ matrix.os != 'windows-latest' }}
run: wget ${{ matrix.CSPICE_URL }}
- name: Download CSPICE (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: wget ${{ matrix.CSPICE_URL }} -outfile cspice.zip
- name: Extract CSPICE
if: ${{ matrix.os != 'windows-latest' }}
run: tar -zxvf "${CSPICE_URL##*/}"
- name: Extract CSPICE (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: tar -xf cspice.zip
- name: Fix libcspice name
if: ${{ matrix.os != 'windows-latest' }}
run: mv $CSPICE_DIR/lib/cspice.a $CSPICE_DIR/lib/libcspice.a
- name: Cargo Test
run: cargo test -- --nocapture --test-threads=1
- name: Cargo Clippy Check
run: cargo clippy --workspace -- -D warnings
build_with_auto_download:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Cargo Test
run: cargo test --features downloadcspice -- --nocapture --test-threads=1
- name: Cargo Clippy Check
run: cargo clippy --features downloadcspice --workspace -- -D warnings
check_style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cargo Format Check
run: cargo fmt -- --check
- name: Cargo Sort Check
run: cargo install cargo-sort && cargo-sort --check --workspace