Skip to content

Commit 18b1691

Browse files
authored
build: Integrate codecov (#179)
1 parent 5fd96ec commit 18b1691

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,58 @@ jobs:
193193
- run: cargo hack check --feature-powerset --lib
194194
working-directory: ./css-inline
195195

196+
coverage:
197+
name: Code coverage
198+
runs-on: ubuntu-20.04
199+
steps:
200+
- uses: actions/checkout@v2
201+
with:
202+
submodules: true
203+
204+
- name: Toolchain setup
205+
uses: actions-rs/toolchain@v1
206+
with:
207+
toolchain: nightly
208+
override: true
209+
210+
- name: Install `cargo-tarpaulin`
211+
run: cargo install cargo-tarpaulin
212+
213+
- name: Cache cargo
214+
uses: actions/cache@v3
215+
with:
216+
path: |
217+
~/.cargo/registry
218+
~/.cargo/git
219+
target
220+
key: coverage-cargo-cache
221+
222+
- uses: actions/setup-python@v2
223+
with:
224+
python-version: 3.7
225+
226+
- name: Start background server
227+
run: |
228+
python -m pip install flask
229+
# Starts the server in background
230+
python ./css-inline/tests/server.py &
231+
232+
- name: Run tests
233+
run: cargo tarpaulin --verbose --all-features --out Xml
234+
working-directory: ./css-inline
235+
236+
- name: Upload coverage to Codecov
237+
uses: codecov/codecov-action@v3
238+
if: ${{ env.GITHUB_REPOSITORY }} == 'Stranger6667/css-inline'
239+
with:
240+
name: coverage
241+
196242
fuzz:
197243
name: Fuzz
198244
runs-on: ubuntu-20.04
199245
steps:
200246
- uses: actions/checkout@v3
201247
- uses: dtolnay/rust-toolchain@nightly
202248
- run: cargo install cargo-fuzz
203-
- run: cargo fuzz build -O
249+
- run: cargo fuzz run inline -- -max_total_time=60
204250
working-directory: ./css-inline

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# css-inline
22

33
[![ci](https://github.com/Stranger6667/css-inline/workflows/ci/badge.svg)](https://github.com/Stranger6667/css-inline/actions)
4+
[![codecov](https://codecov.io/gh/Stranger6667/css-inline/branch/master/graph/badge.svg)](https://codecov.io/gh/Stranger6667/css-inline)
45
[![Crates.io](https://img.shields.io/crates/v/css-inline.svg)](https://crates.io/crates/css-inline)
56
[![docs.rs](https://docs.rs/css-inline/badge.svg)](https://docs.rs/css-inline/)
67
[![gitter](https://img.shields.io/gitter/room/Stranger6667/css-inline.svg)](https://gitter.im/Stranger6667/css-inline)

0 commit comments

Comments
 (0)