-
Notifications
You must be signed in to change notification settings - Fork 32
129 lines (120 loc) · 3.57 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
name: CI
on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get -y install libfontconfig1-dev
- run: cargo clippy --tests --features serde -- -D warnings
test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get -y install libfontconfig1-dev
if: matrix.os == 'ubuntu-latest'
- name: Install LLVM
if: matrix.os == 'windows-2019'
run: choco install -y llvm
- name: Setup msbuild
if: matrix.os == 'windows-2019'
uses: microsoft/[email protected]
- run: cargo test --features serde
timeout-minutes: 20
if: matrix.os == 'windows-2019'
env:
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\bin"
- run: cargo test --features serde
if: matrix.os != 'windows-2019'
- name: Test package mupdf-sys
if: matrix.os == 'ubuntu-latest'
run: cargo package --manifest-path mupdf-sys/Cargo.toml
test-msys:
name: Test Suite (MSYS2)
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
include:
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: mingw64, env: x86_64 }
- { sys: mingw32, env: i686 }
- { sys: clang64, env: clang-x86_64 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: mingw-w64-${{matrix.env}}-rust mingw-w64-${{matrix.env}}-clang base base-devel unzip git
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 500
- run: |
rustc --version --verbose
cargo test --features serde
asan:
name: Address Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- run: sudo apt-get -y install libfontconfig1-dev
- name: cargo test --features serde
run: |
cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --features serde
env:
RUSTFLAGS: -Zsanitizer=address
LSAN_OPTIONS: report_objects=1
valgrind:
name: Valgrind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@valgrind
- run: sudo apt-get -y install libfontconfig1-dev
- run: cargo test --features serde
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --error-exitcode=1 --track-origins=yes"
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check