-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fixes; added all tests; actions added
- Loading branch information
Mr Martian
committed
Jul 29, 2024
1 parent
cb28263
commit cab6ea7
Showing
69 changed files
with
541 additions
and
136 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,82 @@ | ||
name: coveralls | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
name: Coveralls Upload | ||
runs-on: ubuntu-latest | ||
|
||
# setup | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: 1.1.16 | ||
|
||
- name: Install dependencies | ||
run: bun install | ||
|
||
# Bun tests | ||
|
||
- name: Run JavaScript/TypeScript tests | ||
run: bun run test | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
# setup rust | ||
|
||
- name: Install Clippy | ||
run: rustup component add clippy | ||
|
||
- name: Install llvm-tools-preview | ||
run: rustup component add llvm-tools-preview | ||
|
||
- name: Install grcov | ||
run: | | ||
sudo apt-get install lcov | ||
cargo install grcov | ||
- name: Build Rust project | ||
run: cargo build | ||
shell: bash | ||
|
||
# Rust tests | ||
|
||
- name: Run Rust tests with coverage | ||
run: | | ||
export CARGO_INCREMENTAL=0 | ||
export RUSTFLAGS='-Cinstrument-coverage' | ||
export LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' | ||
cargo test --lib | ||
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*/.cargo/*" --ignore "/*/target/*" -o ./coverage/rust-lcov.info | ||
shell: bash | ||
|
||
# Merge LCOV reports | ||
|
||
- name: Merge Bun and Rust LCOV reports | ||
run: | | ||
mkdir -p coverage | ||
if [ -f ./coverage/lcov.info ] && [ -f ./coverage/rust-lcov.info ]; then | ||
cat ./coverage/rust-lcov.info >> ./coverage/lcov.info | ||
elif [ -f ./coverage/rust-lcov.info ]; then | ||
mv ./coverage/rust-lcov.info ./coverage/lcov.info | ||
fi | ||
# upload to Coveralls | ||
|
||
- name: Upload coverage to Coveralls | ||
run: | | ||
if [ -f ./coverage/lcov.info ]; then | ||
bun run coveralls < ./coverage/lcov.info | ||
fi | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
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,48 @@ | ||
name: test-workflow | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: 1.1.16 | ||
|
||
- name: Install dependencies | ||
run: bun install | ||
|
||
- name: Run JavaScript/TypeScript tests | ||
run: bun run test | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install Clippy | ||
run: rustup component add clippy | ||
|
||
- name: Run Clippy | ||
run: cargo clippy -- -D warnings | ||
shell: bash | ||
|
||
- name: Build Rust project | ||
run: cargo build | ||
shell: bash | ||
|
||
- name: Run Rust tests | ||
run: cargo test | ||
shell: bash |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<?xml version="1.0"?><coverage lines-covered="60" lines-valid="62" line-rate="0.967741935483871" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0" version="1.9" timestamp="1722254116"><sources><source>/Users/craigoconnor/Documents/Projects/OpenS2/s2json</source></sources><packages><package name="rust" line-rate="0.967741935483871" branch-rate="0" complexity="0"><classes><class name="geometry" filename="rust/geometry.rs" line-rate="0.9615384615384616" branch-rate="0" complexity="0"><methods/><lines><line number="33" hits="1"/><line number="37" hits="2"/><line number="38" hits="0"/><line number="39" hits="1"/><line number="40" hits="1"/><line number="41" hits="1"/><line number="42" hits="1"/><line number="50" hits="1"/><line number="58" hits="1"/><line number="62" hits="1"/><line number="64" hits="1"/><line number="65" hits="1"/><line number="68" hits="2"/><line number="72" hits="3"/><line number="73" hits="2"/><line number="74" hits="2"/><line number="75" hits="2"/><line number="76" hits="2"/><line number="77" hits="2"/><line number="78" hits="2"/><line number="79" hits="2"/><line number="80" hits="2"/><line number="84" hits="1"/><line number="111" hits="2"/><line number="115" hits="4"/><line number="116" hits="0"/><line number="117" hits="2"/><line number="118" hits="2"/><line number="119" hits="2"/><line number="120" hits="2"/><line number="121" hits="2"/><line number="122" hits="2"/><line number="130" hits="2"/><line number="138" hits="2"/><line number="142" hits="2"/><line number="144" hits="2"/><line number="145" hits="2"/><line number="148" hits="4"/><line number="152" hits="6"/><line number="153" hits="4"/><line number="154" hits="4"/><line number="155" hits="4"/><line number="156" hits="4"/><line number="157" hits="4"/><line number="158" hits="4"/><line number="159" hits="4"/><line number="160" hits="4"/><line number="161" hits="4"/><line number="162" hits="4"/><line number="163" hits="4"/><line number="164" hits="4"/><line number="168" hits="2"/></lines></class><class name="lib" filename="rust/lib.rs" line-rate="1" branch-rate="0" complexity="0"><methods/><lines><line number="43" hits="6"/><line number="44" hits="6"/><line number="48" hits="6"/><line number="49" hits="6"/><line number="50" hits="1"/><line number="51" hits="1"/><line number="52" hits="1"/><line number="53" hits="1"/><line number="54" hits="1"/><line number="55" hits="1"/></lines></class></classes></package></packages></coverage> |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.