Skip to content

Commit 0ac1b57

Browse files
committed
optimize README.md
1 parent 6f9d8bb commit 0ac1b57

File tree

7 files changed

+98
-13
lines changed

7 files changed

+98
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
push:
55
paths-ignore:
66
- '**.md'
7+
- '**.png'
78
pull_request:
89
paths-ignore:
910
- '**.md'
11+
- '**.png'
1012

1113
env:
1214
CARGO_TERM_COLOR: always

.github/workflows/coverage.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Code Coverage
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
- '**.png'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- '**.png'
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
coverage:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: nightly-2024-08-02
24+
override: true
25+
- name: Build
26+
run: cargo build --release --all-features --all --verbose
27+
- name: Run tests
28+
run: cargo test --release --all-features --all --verbose
29+
env:
30+
CARGO_INCREMENTAL: '0'
31+
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
32+
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
33+
- name: rust-grcov
34+
# You may pin to the exact commit or the version.
35+
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248
36+
uses: actions-rs/[email protected]
37+
- name: Codecov
38+
# You may pin to the exact commit or the version.
39+
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
40+
uses: codecov/codecov-action@v5
41+
env:
42+
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
43+
with:
44+
# Repository upload token - get it from codecov.io. Required only for private repositories
45+
# token: # optional
46+
# Specify whether the Codecov output should be verbose
47+
verbose: true
48+
fail_ci_if_error: true

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
language: rust
2+
3+
sudo: required
4+
5+
rust:
6+
- stable
7+
- nightly
8+
9+
matrix:
10+
allow_failures:
11+
- rust: nightly
12+
13+
addons:
14+
apt:
15+
packages:
16+
- libcurl4-openssl-dev
17+
- libelf-dev
18+
- libdw-dev
19+
- cmake
20+
- gcc
21+
- binutils-dev
22+
- libiberty-dev
23+
24+
after_success: |
25+
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
26+
tar xzf master.tar.gz &&
27+
cd kcov-master &&
28+
mkdir build &&
29+
cd build &&
30+
cmake .. &&
31+
make &&
32+
make install DESTDIR=../../kcov-build &&
33+
cd ../.. &&
34+
rm -rf kcov-master &&
35+
for file in target/release/open-coroutine-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
36+
bash <(curl -s https://codecov.io/bash) &&
37+
echo "Uploaded code coverage"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# open-coroutine
22

3+
[![crates.io](https://img.shields.io/crates/v/open-coroutine.svg)](https://crates.io/crates/open-coroutine)
4+
[![LICENSE](https://img.shields.io/github/license/acl-dev/open-coroutine.svg?style=flat-square)](https://github.com/acl-dev/open-coroutine/blob/master/LICENSE-APACHE)
5+
[![Build Status](https://github.com/acl-dev/open-coroutine/workflows/CI/badge.svg)](https://github.com/acl-dev/open-coroutine/actions)
6+
[![Codecov](https://codecov.io/github/acl-dev/open-coroutine/graph/badge.svg?token=MSM3R7CBEX)](https://codecov.io/github/acl-dev/open-coroutine)
7+
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/acl-dev/open-coroutine.svg)](http://isitmaintained.com/project/acl-dev/open-coroutine "Average time to resolve an issue")
8+
[![Percentage of issues still open](http://isitmaintained.com/badge/open/acl-dev/open-coroutine.svg)](http://isitmaintained.com/project/acl-dev/open-coroutine "Percentage of issues still open")
9+
310
The `open-coroutine` is a simple, efficient and generic stackful-coroutine library.
411

512
<div style="text-align: center;">

core/src/common/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// Check <https://www.rustwiki.org.cn/en/reference/introduction.html> for help information.
1+
//! Check <https://www.rustwiki.org.cn/en/reference/introduction.html> for help information.
22
33
/// Constructs an event at the trace level.
44
#[allow(unused_macros)]

core/src/common/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,7 @@ pub mod work_steal;
7979
/// for i in 0..2 {
8080
/// local1.push_with_priority(i, i);
8181
/// }
82-
/// for i in 0..2 {
83-
/// assert_eq!(local1.pop(), Some(i));
84-
/// }
85-
/// for i in (2..6).rev() {
86-
/// assert_eq!(local1.pop(), Some(i));
87-
/// }
88-
/// for i in 6..8 {
82+
/// for i in 0..8 {
8983
/// assert_eq!(local1.pop(), Some(i));
9084
/// }
9185
/// assert_eq!(local0.pop(), None);

core/src/common/ordered_work_steal.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
338338
/// local1.push_with_priority(i, i);
339339
/// }
340340
/// assert_eq!(local1.len(), 2);
341-
/// for i in 0..2 {
342-
/// assert_eq!(local1.pop(), Some(i));
343-
/// }
344-
/// for i in (2..6).rev() {
341+
/// for i in 0..6 {
345342
/// assert_eq!(local1.pop(), Some(i));
346343
/// }
347344
/// assert_eq!(local0.pop(), None);
@@ -374,7 +371,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
374371
//不能偷自己
375372
continue;
376373
}
377-
for entry in another.iter().rev() {
374+
for entry in another {
378375
let worker = entry.value();
379376
if worker.is_empty() {
380377
//其他队列为空

0 commit comments

Comments
 (0)