Skip to content

Commit

Permalink
add conda and static to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Aug 10, 2020
1 parent 6e0ffc9 commit 0c10ba6
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 37 deletions.
99 changes: 63 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with: {submodules: true}
- name: Install netCDF
run: sudo apt-get install libnetcdf-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -28,13 +31,13 @@ jobs:
- name: Check formatting
run: cargo fmt -- --check
- name: Documentation
run: cargo doc --workspace
run: cargo doc --workspace --exclude netcdf-src
- name: Clippy
run: cargo clippy --workspace -- -D warnings
run: cargo clippy --workspace --exclude netcdf-src -- -D warnings

test:
name: test
runs-on: ${{ matrix.os }}
test_apt:
name: test apt
runs-on: ubuntu-18.04
strategy:
matrix:
build:
Expand All @@ -43,17 +46,15 @@ jobs:
- nightly
include:
- build: stable
os: ubuntu-18.04
rust: stable
- build: beta
os: ubuntu-18.04
rust: beta
- build: nightly
os: ubuntu-18.04
rust: nightly
steps:
- name: Checkout repository
uses: actions/checkout@v2
with: {submodules: false}

- name: Install netcdf
run: sudo apt-get install libnetcdf-dev
Expand All @@ -66,37 +67,63 @@ jobs:
override: true

- name: Build
run: cargo build --verbose --workspace
run: cargo build --verbose --workspace --exclude netcdf-src

- name: Test
run: cargo test --verbose --workspace
run: cargo test --verbose --workspace --exclude netcdf-src
if: matrix.os == 'ubuntu-18.04'

tarpaulin:
name: tarpaulin
runs-on: ubuntu-18.04
conda:
name: conda
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu, channel: conda-forge, rust: stable}
- {os: windows, channel: conda-forge, rust: stable}
- {os: macos, channel: conda-forge, rust: stable}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install netcdf
run: sudo apt-get install libnetcdf-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install tarpaulin
uses: actions-rs/install@v0.1
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true

- name: Tarpaulin
run: cargo tarpaulin --verbose --out Xml --ignore-tests
- name: Checkout repository
uses: actions/checkout@v2
with: {submodules: true}
- name: Install Rust (${{matrix.rust}})
uses: actions-rs/toolchain@v1
with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true}
- name: Install conda
uses: goanpeca/setup-miniconda@v1
with: {auto-update-conda: false, activate-environment: testenv}
- name: Install netCDF
run: conda install -y -c ${{matrix.channel}} libnetcdf=4.7.4
- name: Build and test
run: |
export HDF5_DIR="$CONDA_PREFIX"
[ "${{runner.os}}" != "Windows" ] && export RUSTFLAGS="-C link-args=-Wl,-rpath,$CONDA_PREFIX/lib"
cargo test -vv --workspace --exclude netcdf-src
- name: Upload to codecov
uses: codecov/codecov-action@v1.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
static_builds:
name: static builds
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu, rust: stable}
- {os: windows, rust: stable-msvc}
- {os: windows, rust: stable-gnu}
- {os: macos, rust: stable}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with: {submodules: true}
- name: Install Rust (${{matrix.rust}})
uses: actions-rs/toolchain@v1
with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true}
- name: Build and test
run: cargo test -vv --workspace --features static
34 changes: 34 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: codecov
on: [push]
env:
CARGO_TERM_COLOR: always

jobs:
tarpaulin:
name: tarpaulin
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install netcdf
run: sudo apt-get install libnetcdf-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install tarpaulin
uses: actions-rs/install@v0.1
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true

- name: Tarpaulin
run: cargo tarpaulin --verbose --out Xml --ignore-tests

- name: Upload to codecov
uses: codecov/codecov-action@v1.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ All variable data is read into a contiguous buffer, or inta an [ndarray](https:/

This crate depends on `libnetcdf`, but a static build from source is also supported, which can be enabled using the `static` feature.

The crate is built on several platforms using github actions.
The crate is built on several platforms using github actions, and is currently known to build form from source on all major platforms (linux, macos, windows (gnu+msvc)), and through the package installers `conda` and `apt`.


## Documentation
Expand Down

0 comments on commit 0c10ba6

Please sign in to comment.