-
Notifications
You must be signed in to change notification settings - Fork 23
59 lines (48 loc) · 1.16 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- name: lint
run: cargo clippy
- name: check format
run: cargo fmt --check
- name: test
run: cargo test
test-build-image:
if: "!startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
push: false
release:
name: Publish on crates.io
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [test]
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Publish on crates.io
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
cargo publish