-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update the benchmark. Test both parsing and checking. * Add basic CI. * CI: Fix options of `cargo fmt`. * CI: update toolchain to 1.70 for package `half` It's required by criterion. * CI: update toolchain to 1.74 for package `clap` It's also required by criterion. * CI: temporarily allow some warnings from clippy. Fix those warnings later. * Patch `unicode-width`. 0.1.13 and 0.1.11 produce different results, which cause test failures. * CI: try to fix rustfmt-not-installed error. * CI: add the benchmark. * CI: correct job name. * CI: add en endline to the last of ci.yml * CI: try using bencher. * CI: use dtolnay/rust-toolchain@v1 instead. Also updated the toolchain used in checking and test coverage. * CI: Move benchmark job to another file. Replace `main` with corresponding branch name. Also set `fail_ci_if_error` of test coverage to true. * CI: update workflow names. * Update benchmark measurement time. As CI results suggested. * CI: remove a redundant job and use default adapter of bencher. * CI: remove a redundant space. * CI: use `secrets.CODECOV_TOKEN` due to rate limits
- Loading branch information
1 parent
08e9925
commit b597196
Showing
5 changed files
with
98 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- add-ci # Temporarily used for CI tests. | ||
|
||
name: Benchmark | ||
|
||
jobs: | ||
benchmark: | ||
name: Continuous Benchmarking with Bencher | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: bencherdev/bencher@main | ||
- name: Track base branch benchmarks with Bencher | ||
run: | | ||
bencher run \ | ||
--project pest3 \ | ||
--token '${{ secrets.BENCHER_API_TOKEN }}' \ | ||
--branch ${{ github.ref_name }} \ | ||
--testbed ubuntu-latest \ | ||
--err \ | ||
cargo bench --workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
on: [push] | ||
|
||
name: Build, Lint and Test | ||
|
||
jobs: | ||
check: | ||
name: Rust project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: 1.74 | ||
components: rustfmt, clippy | ||
- name: cargo fmt | ||
run: cargo fmt --all -- --check | ||
- name: cargo clippy | ||
run: cargo clippy --workspace --all-targets # -- -Dwarnings | ||
- name: cargo test | ||
run: cargo test --workspace | ||
- name: cargo doc | ||
run: cargo doc --workspace | ||
|
||
coverage: | ||
name: Test Coverage | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: 1.74 | ||
components: llvm-tools-preview, rustfmt | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Generate code coverage | ||
run: cargo llvm-cov --workspace --lcov --output-path lcov.info | ||
- name: Upload Results to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
file: lcov.info | ||
flags: unittests | ||
name: pest3-ci-coverage | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -673,7 +673,7 @@ mod span { | |
assert_eq!( | ||
msg, | ||
" \ | ||
| v | ||
| v | ||
1 | ß␊ | ||
2 | ∆␊ | ||
3 | 中␊ | ||
|