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

Commit

Permalink
Merge pull request #7 from ka7eh/develop
Browse files Browse the repository at this point in the history
Only run coverage_and_publish step on release
  • Loading branch information
ka7eh authored Aug 15, 2021
2 parents e2de3a9 + 59878fc commit 79cf618
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ on:
types: [published]

jobs:
test:
tests:
runs-on: ubuntu-latest
if: github.event_name != 'release'
strategy:
matrix:
rust:
Expand All @@ -28,15 +29,17 @@ jobs:
with:
command: test

coverage:
coverage_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/[email protected]
- name: Generate coverage info
uses: actions-rs/[email protected]
with:
version: '0.18.0'
args: '-- --test-threads 1'
Expand All @@ -46,10 +49,17 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
path-to-lcov: './lcov.info'
- name: Publish to crates.io
if: github.event_name == 'release'
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_TOKEN }}

fmt:
name: Rustfmt
runs-on: ubuntu-latest
if: github.event_name != 'release'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -66,6 +76,7 @@ jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'release'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -78,19 +89,4 @@ jobs:
with:
command: clippy
args: -- -D warnings

publish:
name: Publish to crates.io
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: publish --token ${{ secrets.CRATES_TOKEN }}

0 comments on commit 79cf618

Please sign in to comment.