-
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.
Try a simple test via GitHub Actions
- Loading branch information
1 parent
c4e2f5a
commit ab169b3
Showing
9 changed files
with
103 additions
and
15 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,45 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
pre_job: | ||
name: Check duplicate | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 | ||
with: | ||
cancel_others: true | ||
concurrent_skipping: same_content | ||
do_not_skip: '["pull_request", "schedule", "workflow_dispatch"]' | ||
|
||
build: | ||
name: Test | ||
needs: pre_job | ||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: git config --global core.autocrlf input | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pipenv' | ||
- name: Install pipenv | ||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python | ||
- run: pipenv install | ||
- name: Compile database | ||
run: pipenv run python compile_db.py --output test/hs.db < test/patterns.json > test/patterns_final.json | ||
- name: Generate test data | ||
run: pipenv run python gen_test_data.py | ||
- name: Preprocess training data | ||
run: pipenv run python preprocess.py train --database test/hs.db --sherlock-path test/ --output-dir test/ | ||
- name: Train the model | ||
run: pipenv run python train.py --sherlock-path test/ --input-dir test/ --output-dir test/ | ||
- name: Preprocess test data | ||
run: pipenv run python preprocess.py test --database test/hs.db --sherlock-path test/ --output-dir test/ | ||
- name: Evaluate the model | ||
run: pipenv run python test.py --sherlock-path test/ --input-dir test/ | grep "weighted avg 1.00" |
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 |
---|---|---|
|
@@ -10,4 +10,5 @@ patterns.json | |
*.json | ||
*.h5 | ||
*.png | ||
*.parquet | ||
regex101/ |
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,16 @@ | ||
import pandas as pd | ||
|
||
|
||
data = ["['a', 'b', 'c']", "['1', '2', '3']"] | ||
df = pd.DataFrame(data, columns=['values']) | ||
df.to_parquet('test/test_values.parquet', index=True) | ||
|
||
df = pd.DataFrame(data * 100, columns=['values']) | ||
df.to_parquet('test/train_values.parquet', index=True) | ||
|
||
labels = ["alpha", "numeric"] | ||
df = pd.DataFrame(labels, columns=['type']) | ||
df.to_parquet('test/test_labels.parquet', index=True) | ||
|
||
df = pd.DataFrame(labels * 100, columns=['type']) | ||
df.to_parquet('test/train_labels.parquet', index=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 |
---|---|---|
@@ -0,0 +1 @@ | ||
!patterns.json |
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,2 @@ | ||
"^[A-Za-z]$" | ||
"^[0-9]$" |
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