-
Notifications
You must be signed in to change notification settings - Fork 44
102 lines (93 loc) · 2.67 KB
/
rust.yml
File metadata and controls
102 lines (93 loc) · 2.67 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
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
name: Rust
on:
push:
branches: [ master, release-* ]
paths-ignore:
- '.github/workflows/docs.yml'
- '.github/workflows/keyvi.yml'
- '.github/workflows/python**.yml'
- 'docker/**'
- 'doc/**'
- 'python/**'
pull_request:
branches: [master]
paths-ignore:
- '.github/workflows/docs.yml'
- '.github/workflows/keyvi.yml'
- '.github/workflows/python**.yml'
- 'docker/**'
- 'doc/**'
- 'python/**'
release:
types: [published]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: swatinem/rust-cache@v2
with:
workspaces: |
rust
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y libsnappy-dev libzzip-dev zlib1g-dev libboost-all-dev
- name: Code fomatting
run: cargo fmt --manifest-path rust/Cargo.toml -- --check
- name: Build
run: cargo build --verbose --manifest-path rust/Cargo.toml
- name: Run tests
run: cargo test --verbose --manifest-path rust/Cargo.toml
build_latest_deps:
name: Latest Dependencies
runs-on: ubuntu-latest
continue-on-error: true
env:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow
steps:
- uses: actions/checkout@v6
- uses: swatinem/rust-cache@v2
with:
workspaces: |
rust
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y libsnappy-dev libzzip-dev zlib1g-dev libboost-all-dev
- run: rustup update stable && rustup default stable
- run: cargo update --verbose --manifest-path rust/Cargo.toml
- run: cargo build --verbose --manifest-path rust/Cargo.toml
- run: cargo test --verbose --manifest-path rust/Cargo.toml
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: build
environment:
name: crates.io
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- uses: swatinem/rust-cache@v2
with:
workspaces: |
rust
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y libsnappy-dev libzzip-dev zlib1g-dev libboost-all-dev
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Publish
run: >
cargo publish
--verbose
--manifest-path rust/Cargo.toml
--locked
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}