Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite JS code to Rust #288

Merged
merged 46 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
31d57b3
feat: support rust cargo
williamdes Aug 3, 2020
fe2e067
chore: refurbish the Rust implementation from 2 years ago
williamdes Nov 26, 2022
71d6974
chore: move JS code into Rust code
williamdes Nov 26, 2022
2393ada
chore: move cleaner.rs to Rust code
williamdes Nov 26, 2022
2c61433
chore: re-build cleaner.js to Rust
williamdes Nov 26, 2022
3340ac8
chore: move mysql.js to mysql.rs
williamdes Nov 26, 2022
057a5d6
chore: rustify the mysql.rs file
williamdes Nov 26, 2022
627ce21
chore: re-implement most of the MySQL parser
williamdes Nov 26, 2022
e1c850a
feat: implement more fields of the struct
williamdes Nov 26, 2022
17f8046
feat: implement serializing data and more options
williamdes Nov 26, 2022
aa239fa
chore: update editorconfig for 2 spaces for data files
williamdes Nov 26, 2022
3ea756d
feat: implement writing files
williamdes Nov 26, 2022
94c3137
feat: handle floats and write all mysql files and use LF instead of CRLF
williamdes Nov 27, 2022
7b57a5c
feat: better implement back the searching for the anchor
williamdes Nov 27, 2022
1c77f85
tests: add more test cases to cover the edge case that was fixed prev…
williamdes Nov 27, 2022
d95e54f
ci: add a workflow to build and test Rust code
williamdes Nov 27, 2022
e5bd8cd
ci: add Rust code coverage
williamdes Nov 27, 2022
b4786c7
ci: try to fixup cargo flags
williamdes Nov 27, 2022
8a8dad9
ci: remove filter: covered
williamdes Nov 27, 2022
ce45275
ci: add debug step
williamdes Nov 27, 2022
c2fd0f5
ci: add cancel in progress workflow
williamdes Nov 27, 2022
7475be1
ci: manually use grcov
williamdes Nov 27, 2022
0614775
ci: add missing component and fix bash commands
williamdes Nov 27, 2022
5221f25
style: remove non used import
williamdes Nov 27, 2022
3972cfc
ci: fix dedupe workflows
williamdes Nov 27, 2022
25fecb1
ci: remove verbose on codecov
williamdes Nov 27, 2022
bbc82fe
chore: ignore new coverage files
williamdes Nov 27, 2022
da5c7d7
ci: cache cargo binaries and install grcov from cargo
williamdes Nov 27, 2022
f83060a
ci: remove non necessary grov config
williamdes Nov 27, 2022
3c3a23e
chore: remove non used commented code
williamdes Nov 27, 2022
7f60823
chore: update test case 4 to remove a specific case that does not exi…
williamdes Nov 27, 2022
0441d2f
chore: move parser test to .rs
williamdes Nov 27, 2022
62102a7
fix: skip serialize if Range is empty
williamdes Nov 27, 2022
f2573fd
feat: implement mariadb parsing
williamdes Nov 30, 2022
4e5d00f
feat: implement back "upwards" on Range
williamdes Nov 30, 2022
5e62fb5
feat: implement has_description
williamdes Nov 30, 2022
e870390
feat: implement more cases to handle range data
williamdes Nov 30, 2022
668ece2
feat: implement back finding type by description
williamdes Nov 30, 2022
7f6c3a7
fix: also handle "type" for data type
williamdes Dec 1, 2022
35f2c28
fix: also detect properly data type with a comment
williamdes Dec 2, 2022
a8e944e
fix: improve range and type detection
williamdes Dec 2, 2022
0f2b9ad
fix: better implement default and key name handling
williamdes Dec 2, 2022
c834981
feat: implement is_removed for mariadb variables
williamdes Dec 2, 2022
3d0a42f
fix: do not allow all default values to use the first <code> tag
williamdes Dec 2, 2022
952ab6e
ci: build
williamdes Dec 2, 2022
e6e8f99
fix: remove keywords
williamdes Dec 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[data/**/*.json]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
composer install --no-interaction
- name: Build
run: |
yarn run build
TODO -> run binary
composer run build
- name: Install sudo-bot
run: yarn global add sudo-bot
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and test rust code

on:
pull_request:
push:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_test:
runs-on: ubuntu-latest
name: Build and test
steps:
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo binaries
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.64.0
override: true
components: rustfmt, llvm-tools-preview
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
- name: Run grcov
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
- uses: codecov/codecov-action@v3
with:
files: ./coverage.lcov
flags: rust
fail_ci_if_error: true # optional (default = false)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ node_modules
/.php_cs.cache
/target
composer.lock
/*.lcov
/*.profraw
Loading