-
Notifications
You must be signed in to change notification settings - Fork 10
137 lines (127 loc) · 4.07 KB
/
ci.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [master, testing, "release/v[0-9].[0-9]"]
pull_request:
branches: [master]
schedule:
- cron: "0 21 * * *"
workflow_dispatch:
jobs:
lint_and_clippy:
name: Lint and Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Run rustfmt
run: cargo fmt --all -- --check
- name: Install dependencies needed to build proj
run: sudo apt install libsqlite3-dev
- name: Run clippy
run: cargo clippy --workspace -- -D warnings
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
with_test: true
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
features: --features gridpoints-proj
with_test: true
# - os: ubuntu-latest
# target: x86_64-unknown-linux-musl
# features: --features gridpoints-proj
# with_test: false
- os: windows-latest
target: x86_64-pc-windows-msvc
with_test: true
- os: macOS-latest
target: x86_64-apple-darwin
with_test: true
- os: macOS-latest
target: x86_64-apple-darwin
features: --features gridpoints-proj
with_test: true
- os: macOS-latest
target: aarch64-apple-darwin
features: --features gridpoints-proj
with_test: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
# - name: Set up musl
# if: matrix.target == 'x86_64-unknown-linux-musl'
# run: |
# rustup target add x86_64-unknown-linux-musl
# sudo apt -qq install musl-tools
# - name: Set up C++ build tools for building PROJ
# if: matrix.target == 'x86_64-unknown-linux-musl'
# run: |
# sudo apt -qq install build-essential g++-multilib
# sudo ln -s /usr/bin/g++ /usr/bin/musl-g++
- name: Install dependencies needed to build proj
run: sudo apt install libsqlite3-dev
if: matrix.os == 'ubuntu-latest'
- name: Build
run: cargo build --target ${{ matrix.target }} --verbose --workspace ${{ matrix.features }}
- name: Run tests
if: matrix.with_test
run: cargo test --target ${{ matrix.target }} --verbose --workspace ${{ matrix.features }}
build_wasm:
name: Building library for wasm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Build
run: cargo build --target wasm32-unknown-unknown --verbose
address_sanitizer:
name: Address sanitizer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies needed to build proj
run: sudo apt install libsqlite3-dev
- name: Run test with sanitizer
env:
RUSTFLAGS: -Z sanitizer=address
RUSTDOCFLAGS: -Z sanitizer=address
run: cargo test --target x86_64-unknown-linux-gnu --workspace --features gridpoints-proj
check_github_config_formats:
name: Check GitHub config formats
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Prettier
run: npm install -g prettier
- name: Run prettier
run: prettier .github --check