Skip to content

CI

CI #1441

Workflow file for this run

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: 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: 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: 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