Skip to content

Commit

Permalink
ci: get the samples datas
Browse files Browse the repository at this point in the history
  • Loading branch information
badele committed Nov 15, 2023
1 parent 300f1c0 commit 32607d1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
- canary
os:
- ubuntu-22.04
- windows-2022
- macOS-12
steps:
- uses: actions/checkout@main
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.coverage
samples/*.csv
samples/*.db
samples/tennis_atp
samples_regenerated.cfwf
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BROWSER := "chromium"
cog check

# Execute test tasks
@test: generate-samples
@test: import-atp generate-samples
deno run -A samples/scripts/generate_samples.ts
rm -rf ./.coverage
deno test --doc --unstable --allow-all --parallel --coverage=./.coverage --trace-ops
Expand Down
6 changes: 4 additions & 2 deletions samples/scripts/import-atp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

# SRCDATAS="/home/badele/ghq/github.com/JeffSackmann/tennis_atp"
cd samples || exit
test -d tennis_atp || git clone https://github.com/JeffSackmann/tennis_atp.git && cd tennis_atp && git checkout 3a02d8f

rm -f samples/samples.db
cd ../..
rm -f samples/samples.db
sqlite3 -bail samples/samples.db < samples/scripts/import-atp.sql
34 changes: 17 additions & 17 deletions samples/scripts/import-atp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

.read './samples/scripts/init_schema.sql'

.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_players.csv' players

.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_rankings_00s.csv' rankings
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_rankings_10s.csv' rankings
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_rankings_20s.csv' rankings

.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2022.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2021.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2020.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2019.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2018.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2017.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2016.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2015.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2014.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2013.csv' matches
.import --csv '/home/badele/ghq/github.com/JeffSackmann/tennis_atp/atp_matches_2012.csv' matches
.import --csv 'samples/tennis_atp/atp_players.csv' players

.import --csv 'samples/tennis_atp/atp_rankings_00s.csv' rankings
.import --csv 'samples/tennis_atp/atp_rankings_10s.csv' rankings
.import --csv 'samples/tennis_atp/atp_rankings_20s.csv' rankings

.import --csv 'samples/tennis_atp/atp_matches_2022.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2021.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2020.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2019.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2018.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2017.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2016.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2015.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2014.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2013.csv' matches
.import --csv 'samples/tennis_atp/atp_matches_2012.csv' matches

-- SELECT ranking_date,substr(ranking_date,1,4) as year,ioc,name_first,name_last,points
-- FROM atp_rankings r INNER JOIN atp_players p ON (r.player=p.player_id)
Expand Down

0 comments on commit 32607d1

Please sign in to comment.