-
Notifications
You must be signed in to change notification settings - Fork 84
130 lines (114 loc) · 3.24 KB
/
rust.yaml
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
130
name: Rust
permissions:
contents: read
on:
pull_request:
paths-ignore:
- 'bindings/**'
- 'examples/**'
- '.github/workflows/python.yaml'
- '.github/workflows/python-version-bump.yaml'
- '.github/workflows/node.yaml'
- '.github/workflows/node-version-bump.yaml'
push:
branches:
- master
tags-ignore:
- '**'
paths-ignore:
- 'bindings/**'
- 'examples/**'
- '.github/workflows/python.yaml'
- '.github/workflows/python-version-bump.yaml'
- '.github/workflows/node.yaml'
- '.github/workflows/node-version-bump.yaml'
env:
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test:
name: cargo test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup install 1.80
- run: cargo test --workspace --all-features --exclude zen-ffi --exclude zen-nodejs --exclude zen-python
- run: cargo test --workspace --all-features --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --release
build:
name: cargo +${{ matrix.rust }} build
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo build --tests
bench:
name: cargo bench
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo bench --workspace
miri:
name: cargo miri test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup toolchain install nightly-2024-07-13 --component miri && rustup default nightly-2024-07-13
- run: cargo miri test --workspace --all-features
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
fmt:
name: Cargo FMT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all -- --check
release:
name: Cargo Release
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'chore(release): publish core')"
needs:
- test
- build
- bench
- miri
- fmt
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- name: Login to Crates.IO
run: cargo login ${{ secrets.CRATES_TOKEN }}
- name: Publish Expression
run: cd core/expression && cargo publish
- name: Publish Template
run: cd core/template && cargo publish
- name: Publish Engine
run: cd core/engine && cargo publish