Skip to content

Commit

Permalink
Merge pull request #546 from charlottia/push-slppopkskyyx
Browse files Browse the repository at this point in the history
add --all-features to CI matrix, add missing shortcode case.
  • Loading branch information
charlottia authored Feb 28, 2025
2 parents ce89ecf + 819d070 commit f368cfc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
- name: Obtain Rust
run: rustup override set ${{ matrix.rust }}
- name: Build library
run: cargo build --verbose --lib
run: cargo build --locked --verbose --lib
- name: Build examples
run: cargo build --verbose --lib --examples
run: cargo build --locked --verbose --lib --examples
- name: Run unit tests
run: cargo test --verbose
- name: "Run README sample (TODO: update me)"
run: cargo run --example sample
run: cargo test --locked --verbose
- name: "Run README sample"
run: cargo run --locked --example sample
build_bin_spec:
runs-on: ubuntu-latest
strategy:
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Obtain Rust
run: rustup override set ${{ matrix.rust }}
- name: Build binary
run: cargo build --verbose --bin comrak --release
run: cargo build --locked --verbose --bin comrak --release
- name: Run spec tests
run: script/cibuild
build_wasm:
Expand All @@ -66,9 +66,9 @@ jobs:
- name: Setup for wasm
run: rustup target add wasm32-unknown-unknown
- name: Build
run: cargo build --verbose --target wasm32-unknown-unknown
run: cargo build --locked --verbose --target wasm32-unknown-unknown
- name: Build examples
run: cargo build --verbose --target wasm32-unknown-unknown --examples
run: cargo build --locked --verbose --target wasm32-unknown-unknown --examples
no_features_build_test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -85,17 +85,24 @@ jobs:
- name: Obtain Rust
run: rustup override set ${{ matrix.rust }}
- name: Build and test with no features
run: cargo test --no-default-features --tests
lockfile:
run: cargo test --locked --no-default-features
all_features_build_test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- nightly
- beta
- stable
- $MSRV
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Obtain Rust
run: rustup override set $MSRV
run: rustup override set ${{ matrix.rust }}
- name: Build and test with no features
run: cargo +stable build --locked --release --all-features
run: cargo test --locked --all-features
clippy_format:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 14 additions & 0 deletions src/tests/sourcepos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ const FOOTNOTE_REFERENCE: TestCase = (
"#,
);

#[cfg(feature = "shortcodes")]
const SHORTCODE: TestCase = (
&[sourcepos!((2:2-2:7))],
r#"nya~
!:fire:!
"#,
);

const TABLE: TestCase = (
&[sourcepos!((3:1-5:17))],
r#"stuff before
Expand Down Expand Up @@ -440,6 +448,8 @@ fn node_values() -> HashMap<NodeValueDiscriminants, TestCase> {
ThematicBreak => THEMATIC_BREAK,
FootnoteDefinition => FOOTNOTE_DEFINITION,
FootnoteReference => FOOTNOTE_REFERENCE,
#[cfg(feature = "shortcodes")]
ShortCode => SHORTCODE,
Table => TABLE,
TableRow => TABLE_ROW,
TableCell => TABLE_CELL,
Expand Down Expand Up @@ -485,6 +495,10 @@ fn sourcepos() {
options.extension.superscript = true;
options.extension.subscript = true;
options.extension.autolink = true;
#[cfg(feature = "shortcodes")]
{
options.extension.shortcodes = true;
}
options.extension.math_code = true;
options.extension.math_dollars = true;
options.extension.multiline_block_quotes = true;
Expand Down

0 comments on commit f368cfc

Please sign in to comment.