Skip to content

Commit

Permalink
Misc updates for CI and workspace cache
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlarumbe committed Aug 8, 2023
1 parent 308c95d commit 9a5abc9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
6 changes: 5 additions & 1 deletion test/scripts/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
PKGS_TO_INSTALL=(global universal-ctags python3-pygments silversearcher-ag ripgrep libverilog-perl verilator iverilog nodejs npm)
EXPECTED_INSTALLED_BINARIES=(python global gtags ctags ag rg vhier verilator iverilog nodejs npm)

sudo apt-get update

for pkg in "${PKGS_TO_INSTALL[@]}"; do
echo ""
echo "Installing $pkg"
Expand All @@ -31,7 +33,9 @@ echo "Setting up Verible tools..."
curl -L -o $LATEST_RELEASE_FILE $VERIBLE_GITHUB_URL/$LATEST_RELEASE_URL/$LATEST_RELEASE_FILE
tar xvzf $LATEST_RELEASE_FILE
cd verible-*/bin
export PATH=$PWD:$PATH
sudo cp verible-verilog-ls /usr/bin/verible-verilog-ls
sudo cp verible-verilog-format /usr/bin/verible-verilog-format
sudo cp verible-verilog-lint /usr/bin/verible-verilog-lint
cd -

echo ""
Expand Down
7 changes: 7 additions & 0 deletions test/verilog-ext-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ Otherwise, byte-compile."
(when (functionp 'verilog-ts-mode)
(require 'verilog-ext-tests-tree-sitter)))))

;;; CI
(when (getenv "GITHUB_WORKSPACE")
(setq temporary-file-directory (file-name-concat (getenv "GITHUB_WORKSPACE") "tmp/"))
(make-directory temporary-file-directory :parents))


;;;; Report loaded file
;; TODO: Not sure if this one really reports if functions have been loaded from .eln files
Expand All @@ -107,6 +112,8 @@ Otherwise, byte-compile."
;; try to load files from native compiled instead of byte-compiled or interactive ones.




(provide 'verilog-ext-tests)

;;; verilog-ext-tests.el ends here
2 changes: 1 addition & 1 deletion verilog-ext-hierarchy.el
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Arg ITEM are hierarchy nodes."
hierarchy))

(defun verilog-ext-hierarchy-extract-builtin (module &optional flat-hierarchy)
"Construct hierarchy for MODULE using builtin `hierarchy' package.
"Construct hierarchy for MODULE using builtin backend.
Modules and instances will be analyzed from FLAT-HIERARCHY input if provided.
Otherwise, extract from `verilog-ext-hierarchy-builtin-current-flat-hierarchy':
Expand Down
14 changes: 7 additions & 7 deletions verilog-ext-workspace.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ If set to nil default to search for current project files."
:type '(repeat file)
:group 'verilog-ext-workspace)

(defcustom verilog-ext-workspace-cache-dir (file-name-concat user-emacs-directory "verilog-ext")
"The directory where Verilog-ext cache files will be placed at."
:group 'verilog-ext-workspace
:type 'file)

(defcustom verilog-ext-workspace-compile-cmd nil
"The command used to perform compilation on the workspace."
:group 'verilog-ext-workspace
Expand Down Expand Up @@ -101,6 +96,9 @@ Follow symlinks if optional argument FOLLOW-SYMLINKS is non-nil."


;;;; Cache
(defconst verilog-ext-workspace-cache-dir (file-name-concat user-emacs-directory "verilog-ext")
"The directory where Verilog-ext cache files will be placed at.")

(defvar verilog-ext-workspace-cache-typedefs nil)
(defvar verilog-ext-workspace-cache-tags-defs nil)
(defvar verilog-ext-workspace-cache-tags-refs nil)
Expand Down Expand Up @@ -163,11 +161,13 @@ If optional TYPE arg is passed, only clear that TYPE."
('typedefs (setq verilog-ext-workspace-cache-typedefs nil))
('tags-defs (setq verilog-ext-workspace-cache-tags-defs nil))
('tags-refs (setq verilog-ext-workspace-cache-tags-refs nil))
('hierarchy (setq verilog-ext-workspace-cache-hierarchy nil))
('hierarchy (setq verilog-ext-workspace-cache-hierarchy nil)
(setq verilog-ext-hierarchy-builtin-current-flat-hierarchy nil))
(_ (setq verilog-ext-workspace-cache-typedefs nil)
(setq verilog-ext-workspace-cache-tags-defs nil)
(setq verilog-ext-workspace-cache-tags-refs nil)
(setq verilog-ext-workspace-cache-hierarchy nil)))
(setq verilog-ext-workspace-cache-hierarchy nil)
(setq verilog-ext-hierarchy-builtin-current-flat-hierarchy nil)))
(verilog-ext-workspace-serialize-cache type)
(message "Cleared cache!"))

Expand Down

0 comments on commit 9a5abc9

Please sign in to comment.