-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces a new step in the CI pipeline that downloads necessary models for testing. A new script `download_models.ts` is added which uses Deno to download the models. The CI workflow is updated to run this script before building and testing. Deno is added as a dependency in `devbox.json` and `devbox.lock`.
- Loading branch information
Showing
8 changed files
with
98 additions
and
124 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 |
---|---|---|
|
@@ -20,14 +20,24 @@ jobs: | |
- run: devbox run fmt-check | ||
|
||
test: | ||
runs-on: macos-14 | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-14 | ||
# - ubuntu-latest | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install devbox | ||
uses: jetify-com/[email protected] | ||
- run: devbox run test | ||
- name: Download models | ||
run: devbox run download-models | ||
- name: Build | ||
run: devbox run build | ||
- name: Test | ||
run: devbox run test | ||
|
||
# deploy: | ||
# permissions: | ||
|
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 |
---|---|---|
|
@@ -5,16 +5,17 @@ | |
"[email protected]", | ||
"[email protected]", | ||
"pkg-config@latest", | ||
"curl@latest", | ||
"unzip@latest" | ||
"unzip@latest", | ||
"[email protected]" | ||
], | ||
"shell": { | ||
"scripts": { | ||
"version": "zig version", | ||
"build": "zig build --verbose", | ||
"test": "zig build test --verbose", | ||
"fmt": "zig fmt ./**/*.zig", | ||
"fmt-check": "zig fmt --check ./**/*.zig" | ||
"version": "zig version", | ||
"download-models": "deno run -A ./scripts/download_models.ts", | ||
"build": "zig build --verbose", | ||
"test": "zig build test --verbose", | ||
"fmt": "zig fmt ./**/*.zig", | ||
"fmt-check": "zig fmt --check ./**/*.zig" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,127 +1,51 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"packages": { | ||
"curl@latest": { | ||
"last_modified": "2024-05-06T15:07:38Z", | ||
"resolved": "github:NixOS/nixpkgs/860e65d27036476edfb85dd847d982277880b143#curl", | ||
"[email protected]": { | ||
"last_modified": "2024-05-06T06:27:37Z", | ||
"resolved": "github:NixOS/nixpkgs/dd1290b0f857782a60b251f89651c831cd3eef9d#deno", | ||
"source": "devbox-search", | ||
"version": "8.7.1", | ||
"version": "1.43.1", | ||
"systems": { | ||
"aarch64-darwin": { | ||
"outputs": [ | ||
{ | ||
"name": "bin", | ||
"path": "/nix/store/fk1nbg9csmdskv4w466d779n87bvc3n0-curl-8.7.1-bin", | ||
"default": true | ||
}, | ||
{ | ||
"name": "man", | ||
"path": "/nix/store/kl3ds7m52n7wgz75qcbfinrz1r7cm1i0-curl-8.7.1-man", | ||
"default": true | ||
}, | ||
{ | ||
"name": "dev", | ||
"path": "/nix/store/dzwxhz2kl4asqsqpdzz5yf89j25igwk6-curl-8.7.1-dev" | ||
}, | ||
{ | ||
"name": "devdoc", | ||
"path": "/nix/store/2rhikjyxizidbd4p1hk479vmr9rc8m5h-curl-8.7.1-devdoc" | ||
}, | ||
{ | ||
"name": "out", | ||
"path": "/nix/store/9x1dp01k13riyvk54ciwjf5za8idwmhi-curl-8.7.1" | ||
"path": "/nix/store/kc5aglf91zj78jw4837nazlgr6ys33cp-deno-1.43.1", | ||
"default": true | ||
} | ||
], | ||
"store_path": "/nix/store/fk1nbg9csmdskv4w466d779n87bvc3n0-curl-8.7.1-bin" | ||
"store_path": "/nix/store/kc5aglf91zj78jw4837nazlgr6ys33cp-deno-1.43.1" | ||
}, | ||
"aarch64-linux": { | ||
"outputs": [ | ||
{ | ||
"name": "bin", | ||
"path": "/nix/store/i5l8l75nywb6hkd4g2i332xwm4djjvbh-curl-8.7.1-bin", | ||
"default": true | ||
}, | ||
{ | ||
"name": "man", | ||
"path": "/nix/store/1kdrycxjg247g313pql8lg8dk0bl89lw-curl-8.7.1-man", | ||
"default": true | ||
}, | ||
{ | ||
"name": "debug", | ||
"path": "/nix/store/cdf1fylklg2vbafari42yqp44bmmk5cn-curl-8.7.1-debug" | ||
}, | ||
{ | ||
"name": "dev", | ||
"path": "/nix/store/q91fvqihpnirbm3pz2sq11kjdpj71zl5-curl-8.7.1-dev" | ||
}, | ||
{ | ||
"name": "devdoc", | ||
"path": "/nix/store/9yr2nxivsgd8k8cqabpikbiin1hpqq7r-curl-8.7.1-devdoc" | ||
}, | ||
{ | ||
"name": "out", | ||
"path": "/nix/store/x2ngx6la8fix8iz7zhyi7gkgsszy9kkx-curl-8.7.1" | ||
"path": "/nix/store/c0bg2vwn4mlx0dvaysl67rn5yf73hi40-deno-1.43.1", | ||
"default": true | ||
} | ||
], | ||
"store_path": "/nix/store/i5l8l75nywb6hkd4g2i332xwm4djjvbh-curl-8.7.1-bin" | ||
"store_path": "/nix/store/c0bg2vwn4mlx0dvaysl67rn5yf73hi40-deno-1.43.1" | ||
}, | ||
"x86_64-darwin": { | ||
"outputs": [ | ||
{ | ||
"name": "bin", | ||
"path": "/nix/store/jlhz559xd973by93qj83izdgm1bkwyiw-curl-8.7.1-bin", | ||
"default": true | ||
}, | ||
{ | ||
"name": "man", | ||
"path": "/nix/store/xvrgskrlc8y23kb83adykc79n3m3221f-curl-8.7.1-man", | ||
"default": true | ||
}, | ||
{ | ||
"name": "dev", | ||
"path": "/nix/store/x2vxybfyjv3ga3wdifn5m9xjmn7wjjk9-curl-8.7.1-dev" | ||
}, | ||
{ | ||
"name": "devdoc", | ||
"path": "/nix/store/cayjhlcrvyq27rzk0p6fj3f8ik5757h5-curl-8.7.1-devdoc" | ||
}, | ||
{ | ||
"name": "out", | ||
"path": "/nix/store/zjjazsh938488vqj83b73wi0dg8xw9p3-curl-8.7.1" | ||
"path": "/nix/store/jzhp7f068y0ph8vyhrwvy86y4lfh969s-deno-1.43.1", | ||
"default": true | ||
} | ||
], | ||
"store_path": "/nix/store/jlhz559xd973by93qj83izdgm1bkwyiw-curl-8.7.1-bin" | ||
"store_path": "/nix/store/jzhp7f068y0ph8vyhrwvy86y4lfh969s-deno-1.43.1" | ||
}, | ||
"x86_64-linux": { | ||
"outputs": [ | ||
{ | ||
"name": "bin", | ||
"path": "/nix/store/rzqab54yp9a21sii4q59v9mlvn15nxxd-curl-8.7.1-bin", | ||
"default": true | ||
}, | ||
{ | ||
"name": "man", | ||
"path": "/nix/store/gx188rl2rmj99k6s65ylvcpavxrwqla9-curl-8.7.1-man", | ||
"default": true | ||
}, | ||
{ | ||
"name": "debug", | ||
"path": "/nix/store/51lgfz0ghqn4pp7wg0wpr9lk62sxpsgx-curl-8.7.1-debug" | ||
}, | ||
{ | ||
"name": "dev", | ||
"path": "/nix/store/n6q80yww217mly3ac6k2vdrd2zvrjk2c-curl-8.7.1-dev" | ||
}, | ||
{ | ||
"name": "devdoc", | ||
"path": "/nix/store/vm8qcnr0xw33aqxl53shcgrk4cqdq1hb-curl-8.7.1-devdoc" | ||
}, | ||
{ | ||
"name": "out", | ||
"path": "/nix/store/qv1qp23si0prgzcx6b8522f0g7fipaph-curl-8.7.1" | ||
"path": "/nix/store/vvq3r8xjg85892anwj74n154ail9bfs6-deno-1.43.1", | ||
"default": true | ||
} | ||
], | ||
"store_path": "/nix/store/rzqab54yp9a21sii4q59v9mlvn15nxxd-curl-8.7.1-bin" | ||
"store_path": "/nix/store/vvq3r8xjg85892anwj74n154ail9bfs6-deno-1.43.1" | ||
} | ||
} | ||
}, | ||
|
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,42 @@ | ||
#!/usr/bin/env -S deno run -A | ||
import { $ } from "jsr:@david/[email protected]"; | ||
|
||
$.setPrintCommand(true); | ||
|
||
const MODEL_URLS = [ | ||
"http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel", | ||
"https://raw.githubusercontent.com/opencv/opencv_extra/20d18acad1bcb312045ea64a239ebe68c8728b88/testdata/dnn/bvlc_googlenet.prototxt", | ||
"https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip", | ||
"https://github.com/onnx/models/raw/4eff8f9b9189672de28d087684e7085ad977747c/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx", | ||
"https://github.com/opencv/opencv_3rdparty/raw/dnn_samples_face_detector_20170830/res10_300x300_ssd_iter_140000.caffemodel", | ||
"https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt", | ||
] as const; | ||
|
||
/** get the root of the git repository */ | ||
const git_root = await $`git rev-parse --show-toplevel`.text(); | ||
|
||
/** save the models in the zig-cache/tmp/ directory */ | ||
const saveDir = $.path(git_root).join("./zig-cache/tmp/"); | ||
|
||
/** create the directory if it does not exist */ | ||
await $`mkdir -p ${saveDir.toString()}`; | ||
|
||
$.cd(saveDir); | ||
|
||
/** list the files in the directory */ | ||
await $`ls -lh ${saveDir}`; | ||
|
||
/** download the models */ | ||
const downloadedPath = await Promise.all( | ||
MODEL_URLS.map((url) => $.request(url).showProgress().pipeToPath()), | ||
); | ||
|
||
/** decompress the zip files */ | ||
await Promise.all( | ||
downloadedPath | ||
.filter((path) => path.extname() === ".zip") | ||
.map((path) => $`unzip -o ${path}`), | ||
); | ||
|
||
/** list the files in the directory */ | ||
await $`ls -lh ${saveDir}`; |
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