-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 889 Bytes
/
ci.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
name: CI Rust testing
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup update stable && rustup default stable
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
publish:
name: Publish to crates.io
needs: build_and_test
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
run: rustup update stable && rustup default stable
- name: Publish to crates.io
run: cargo publish --verbose --locked --token ${{ secrets.CARGO_REGISTRY_TOKEN }}