Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 53 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Rust
on:
push:
pull_request:
branches: [ master ]
branches: [master]
workflow_dispatch:

env:
Expand All @@ -13,17 +13,21 @@ jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- 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
- uses: actions/checkout@v5
- 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
Expand All @@ -33,6 +37,10 @@ jobs:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow
steps:
- uses: actions/checkout@v5
- uses: swatinem/rust-cache@v2
with:
workspaces: |
rust
- name: Install system packages
run: |
sudo apt-get update
Expand All @@ -42,3 +50,36 @@ jobs:
- 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@v5
- 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 }}
Loading