8
8
types : [published]
9
9
10
10
jobs :
11
- test :
11
+ tests :
12
12
runs-on : ubuntu-latest
13
+ if : github.event_name != 'release'
13
14
strategy :
14
15
matrix :
15
16
rust :
@@ -28,15 +29,17 @@ jobs:
28
29
with :
29
30
command : test
30
31
31
- coverage :
32
+ coverage_and_publish :
32
33
runs-on : ubuntu-latest
33
34
steps :
34
35
- uses : actions/checkout@v2
35
36
- uses : actions-rs/toolchain@v1
36
37
with :
38
+ profile : minimal
37
39
toolchain : stable
38
40
override : true
39
- -
uses :
actions-rs/[email protected]
41
+ - name : Generate coverage info
42
+ uses :
actions-rs/[email protected]
40
43
with :
41
44
version : ' 0.18.0'
42
45
args : ' -- --test-threads 1'
@@ -46,10 +49,17 @@ jobs:
46
49
with :
47
50
github-token : ${{secrets.GITHUB_TOKEN}}
48
51
path-to-lcov : ' ./lcov.info'
52
+ - name : Publish to crates.io
53
+ if : github.event_name == 'release'
54
+ uses : actions-rs/cargo@v1
55
+ with :
56
+ command : publish
57
+ args : --token ${{ secrets.CRATES_TOKEN }}
49
58
50
59
fmt :
51
60
name : Rustfmt
52
61
runs-on : ubuntu-latest
62
+ if : github.event_name != 'release'
53
63
steps :
54
64
- uses : actions/checkout@v2
55
65
- uses : actions-rs/toolchain@v1
66
76
clippy :
67
77
name : Clippy
68
78
runs-on : ubuntu-latest
79
+ if : github.event_name != 'release'
69
80
steps :
70
81
- uses : actions/checkout@v2
71
82
- uses : actions-rs/toolchain@v1
78
89
with :
79
90
command : clippy
80
91
args : -- -D warnings
81
-
82
- publish :
83
- name : Publish to crates.io
84
- runs-on : ubuntu-latest
85
- if : github.event_name == 'release'
86
- steps :
87
- - uses : actions/checkout@v2
88
- - uses : actions-rs/toolchain@v1
89
- with :
90
- profile : minimal
91
- toolchain : stable
92
- override : true
93
- - uses : actions-rs/cargo@v1
94
- with :
95
- command : publish --token ${{ secrets.CRATES_TOKEN }}
96
92
0 commit comments