-
Notifications
You must be signed in to change notification settings - Fork 14
68 lines (63 loc) · 2.07 KB
/
main.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
name: CI
on: [push, pull_request]
jobs:
build_and_test:
name: "${{ matrix.name }}"
runs-on: "${{ matrix.image_name }}"
strategy:
matrix:
include:
- name: "macOS"
image_name: "macOS-latest"
- name: "Windows"
image_name: "windows-2022"
- name: "Linux (default features)"
image_name: "ubuntu-22.04"
- name: "Linux (all features)"
image_name: "ubuntu-22.04"
extra_args: "--all-features"
- name: "Linux (minimal)"
image_name: "ubuntu-22.04"
extra_args: "--no-default-features"
- name: "Linux (decoder only)"
image_name: "ubuntu-22.04"
extra_args: "--no-default-features --features full-decoder"
- name: "Linux (encoder)"
image_name: "ubuntu-22.04"
extra_args: "--features encoder"
steps:
- name: Checkout
uses: actions/checkout@v3
with: { submodules: recursive }
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --all ${{ matrix.extra_args }}
- name: Validate FFI structs
if: linux
run: |
set -eu
gdb -q target/debug/examples/pattern \
-batch -ex 'source validate-structs.py' \
1>script-out.txt 2>gdb-stderr.txt
if [[ $(cat ./script-out.txt) != *"ALL STRUCTS OK"* ]]; then
echo >&2 "ERROR: struct validation failed!"
echo >&2 "================================"
cat >&2 ./gdb-stderr.txt
echo >&2 "================================"
cat >&2 ./script-out.txt
exit 1
fi
- name: Test
run: cargo test ${{ matrix.extra_args }}
check_rustfmt:
name: "rustfmt"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with: { submodules: recursive }
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Check rustfmt
run: cargo fmt -- --check