explorer: fix blank page on real repos #9
This file contains hidden or 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
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 90 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: system deps (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libpcre3-dev libpcre2-dev libgmp-dev libev-dev | |
| - name: system deps (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install bash pkg-config pcre pcre2 gmp libev coreutils gettext | |
| - uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: "5.3.0" | |
| # opam deps (incl. the memprof-limits pin via semgrep.opam pin-depends) | |
| # + fetch/build/install the tree-sitter runtime locally. | |
| # Retried: the pin fetch hits gitlab.com, which 503s occasionally. | |
| - name: engine deps | |
| run: | | |
| eval $(opam env) | |
| for i in 1 2 3; do | |
| make -C vendor/opengrep install-deps-for-semgrep-core && exit 0 | |
| echo "::warning::engine deps attempt $i failed; retrying in 60s" | |
| sleep 60 | |
| done | |
| exit 1 | |
| - name: build | |
| run: | | |
| eval $(opam env) | |
| . vendor/opengrep/libs/ocaml-tree-sitter-core/tree-sitter-config.sh | |
| dune build nonna | |
| - name: tests | |
| run: | | |
| eval $(opam env) | |
| bash tests/run.sh | |
| bash tests/sanity.sh | |
| bash tests/lsp-smoke.sh | |
| bash tests/mcp-smoke.sh | |
| # CI artifacts, not portable releases: the binary needs the bundled | |
| # libtree-sitter (via the wrapper) and pcre/pcre2 from your package | |
| # manager. Proper static release builds are a separate, tagged affair. | |
| - name: package | |
| run: | | |
| mkdir -p dist/nonna | |
| cp _build/default/nonna/cli/main.exe dist/nonna/nonna | |
| cp vendor/opengrep/libs/ocaml-tree-sitter-core/tree-sitter/lib/libtree-sitter.* dist/nonna/ 2>/dev/null || true | |
| cat > dist/nonna/run.sh <<'WRAP' | |
| #!/usr/bin/env bash | |
| DIR=$(cd "$(dirname "$0")" && pwd) | |
| export LD_LIBRARY_PATH="$DIR:${LD_LIBRARY_PATH:-}" | |
| export DYLD_FALLBACK_LIBRARY_PATH="$DIR:${DYLD_FALLBACK_LIBRARY_PATH:-}" | |
| exec "$DIR/nonna" "$@" | |
| WRAP | |
| chmod +x dist/nonna/run.sh dist/nonna/nonna | |
| tar czf nonna-$(uname -s)-$(uname -m).tar.gz -C dist nonna | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: nonna-${{ runner.os }}-${{ runner.arch }} | |
| path: nonna-*.tar.gz | |
| retention-days: 14 |