-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 1.99 KB
/
workflow.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
name: Build and test
on:
push:
branches:
- main
- develop
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.72.1
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-22.04", "macos-12" ]
openslide_version: [ "openslide3", "openslide4" ]
env:
INSTALL_DEPS_CMD: install-deps-${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || 'macos' }}-${{ matrix.openslide_version }}
TEST_DEBUG_CMD: test-debug-${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || 'macos' }}
TEST_RELEASE_CMD: test-release-${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || 'macos' }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Install dependencies
run: make ${{ env.INSTALL_DEPS_CMD }}
- name: Build & Test (Debug)
run: make ${{ env.TEST_DEBUG_CMD }}
- name: Build & Test (Release)
run: make ${{ env.TEST_RELEASE_CMD }}
doc-rs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- name: Install dependencies ubuntu
run: make install-deps-ubuntu-openslide3
- name: Generate Doc
env:
DOCS_RS: 1
run: cargo doc -v
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pre-commit
run: pip install pre-commit
- name: Pre-commit
run: |
pre-commit install --install-hooks
pre-commit run --all --show-diff-on-failure