Repository navigation
65 lines (55 loc) · 1.44 KB
/
Copy pathci.yml
File metadata and controls
65 lines (55 loc) · 1.44 KB
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
name: CI
on:
push:
branches:
- master
pull_request:
branches: [ "**" ]
env:
RUST_LOG: debug
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
RUSTFLAGS: "-D warnings"
LLVM_CONFIG_PATH: llvm-config-18
jobs:
ci:
name: CI
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install libclang for Linux
run: sudo apt-get update && sudo apt-get install -y llvm-18-dev libclang-18-dev
- name: Install Rust Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: Setup cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ci-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check
- name: Cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --release
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: PHP Test
run: php -d "extension=target/release/libjieba.so" -r "print_r((new Jieba())->cut('我们中出了一个叛徒'));"