Skip to content
This repository was archived by the owner on May 21, 2023. It is now read-only.

Commit 79cf618

Browse files
authored
Merge pull request #7 from ka7eh/develop
Only run coverage_and_publish step on release
2 parents e2de3a9 + 59878fc commit 79cf618

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ on:
88
types: [published]
99

1010
jobs:
11-
test:
11+
tests:
1212
runs-on: ubuntu-latest
13+
if: github.event_name != 'release'
1314
strategy:
1415
matrix:
1516
rust:
@@ -28,15 +29,17 @@ jobs:
2829
with:
2930
command: test
3031

31-
coverage:
32+
coverage_and_publish:
3233
runs-on: ubuntu-latest
3334
steps:
3435
- uses: actions/checkout@v2
3536
- uses: actions-rs/toolchain@v1
3637
with:
38+
profile: minimal
3739
toolchain: stable
3840
override: true
39-
- uses: actions-rs/[email protected]
41+
- name: Generate coverage info
42+
uses: actions-rs/[email protected]
4043
with:
4144
version: '0.18.0'
4245
args: '-- --test-threads 1'
@@ -46,10 +49,17 @@ jobs:
4649
with:
4750
github-token: ${{secrets.GITHUB_TOKEN}}
4851
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 }}
4958

5059
fmt:
5160
name: Rustfmt
5261
runs-on: ubuntu-latest
62+
if: github.event_name != 'release'
5363
steps:
5464
- uses: actions/checkout@v2
5565
- uses: actions-rs/toolchain@v1
@@ -66,6 +76,7 @@ jobs:
6676
clippy:
6777
name: Clippy
6878
runs-on: ubuntu-latest
79+
if: github.event_name != 'release'
6980
steps:
7081
- uses: actions/checkout@v2
7182
- uses: actions-rs/toolchain@v1
@@ -78,19 +89,4 @@ jobs:
7889
with:
7990
command: clippy
8091
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 }}
9692

0 commit comments

Comments
 (0)