Skip to content

Commit

Permalink
chore: Refactor code coverage script.
Browse files Browse the repository at this point in the history
  • Loading branch information
vldm committed Jan 9, 2024
1 parent 0471cfd commit 8378681
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 28 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: ci

on: [push, pull_request]
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
ci:
Expand Down Expand Up @@ -36,9 +42,3 @@ jobs:

- name: test on Nightly
run: cargo test --workspace

- name: coverage
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --out xml
bash <(curl -s https://codecov.io/bash)
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: coverage

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test:
name: coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly

- name: coverage nightly
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --out xml --output-dir ./nightly --workspace
- uses: dtolnay/rust-toolchain@stable

- name: coverage nightly
run: |
cargo tarpaulin --out xml --output-dir ./stable --workspace
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./stable/cobertura.xml,./nightly/cobertura.xml
name: RSTML
8 changes: 8 additions & 0 deletions .tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[unquoted_text_on_stable]
features = "rstml/rawtext-stable-hack"

[custom_node_extendable]
features = "rstml-control-flow/extendable"

[report]
out = ["Xml", "Html"]
21 changes: 0 additions & 21 deletions src/node/raw_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,27 +208,6 @@ impl<C: CustomNode> ParseRecoverable for RawText<C> {
_c: PhantomData,

Check warning on line 208 in src/node/raw_text.rs

View check run for this annotation

Codecov / codecov/patch

src/node/raw_text.rs#L208

Added line #L208 was not covered by tests
})
}
// (input: ParseStream) -> syn::Result<Self> {
// let mut token_stream = TokenStream::new();
// let any_node = |input: ParseStream| {
// input.peek(Token![<])
// || input.peek(Brace)
// || input.peek(LitStr)
// || C::peek_element(&input.fork())
// };
// // Parse any input until catching any node.
// // Fail only on eof.
// while !any_node(input) && !input.is_empty() {
// token_stream.extend([input.parse::<TokenTree>()?])
// }
// Ok(Self {
// token_stream,
// context_span: None,
// #[cfg(feature = "rawtext-stable-hack-module")]
// recovered_text: None,
// _c: PhantomData,
// })
// }
}

impl<C: CustomNode> ToTokens for RawText<C> {
Expand Down

0 comments on commit 8378681

Please sign in to comment.