-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sentry-integration
Signed-off-by: Yash Khare <[email protected]>
- Loading branch information
Showing
19 changed files
with
749 additions
and
258 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,63 @@ | ||
name: Nodejs Build Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
package: | ||
name: Package | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [linux, darwin, win32] # Define the platforms | ||
arch: [x64, arm64] # Define the architectures | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
# Install npm dependencies based on the architecture | ||
- name: Install dependencies | ||
run: | | ||
if [ "${{ matrix.arch }}" == "arm64" ]; then | ||
npm_config_arch=arm64 npm install --build-from-source | ||
else | ||
npm_config_arch=x64 npm install --build-from-source | ||
fi | ||
# Run Rollup for compilation | ||
- name: Run Rollup | ||
run: npm run rollupci | ||
|
||
- name: List contents of out/compiled directory (for debugging) | ||
run: ls -R out/compiled | ||
|
||
- name: Install vsce | ||
run: npm install -g @vscode/vsce | ||
|
||
- name: Package VSIX for the target platform | ||
run: | | ||
case "${{ matrix.os }}" in | ||
linux) vsce package --target linux-${{ matrix.arch }} ;; | ||
darwin) vsce package --target darwin-${{ matrix.arch }} ;; | ||
win32) vsce package --target win32-${{ matrix.arch }} ;; | ||
esac | ||
- name: Capture VSIX filename | ||
id: capture_vsix_file | ||
run: | | ||
VSIX_FILE=$(ls *.vsix) | ||
echo "VSIX_FILE=$VSIX_FILE" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Print VSIX filename | ||
id: print_vsix_file # Renamed to be unique | ||
run: | | ||
echo "Generated package for platform ${{ matrix.os }} and architecture ${{ matrix.arch }}:" | ||
ls *.vsix |
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,5 +1,5 @@ | ||
import { defineConfig } from '@vscode/test-cli'; | ||
|
||
export default defineConfig({ | ||
files: 'out/test/**/*.test.js', | ||
files: 'out/*.test.js', | ||
}); |
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
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,83 @@ | ||
#!/bin/zsh -i | ||
|
||
log_file_path="$1" | ||
|
||
# Extract command from keploy.yml | ||
keploy_config="keploy.yml" | ||
if [[ ! -f "$keploy_config" ]]; then | ||
echo "keploy.yml file not found in the current directory." | ||
exit 1 | ||
fi | ||
|
||
command=$(awk '/command:/ { $1=""; sub(/^ /, ""); print }' "$keploy_config") | ||
|
||
# Check if command is empty | ||
if [[ -z "$command" ]]; then | ||
echo "Command is not specified in keploy.yml." | ||
exit 1 | ||
fi | ||
|
||
# Create log file if it doesn't exist | ||
touch "$log_file_path" | ||
: > "$log_file_path" # Clear the log file | ||
|
||
# Set permissions of the log file | ||
chmod 666 "$log_file_path" | ||
|
||
if [[ "$command" =~ .*"go".* ]]; then | ||
go mod download | ||
go build -o application | ||
|
||
elif [[ "$command" =~ .*"python3".* ]]; then | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
|
||
elif [[ "$command" =~ .*"python".* ]] ; then | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
|
||
elif [[ "$command" =~ .*"node".* ]]; then | ||
npm install | ||
|
||
elif [[ "$command" =~ .*"java".* ]] || [[ "$command" =~ .*"mvn".* ]]; then | ||
mvn clean install | ||
fi | ||
|
||
# Create a named pipe | ||
fifo=$(mktemp -u) | ||
mkfifo "$fifo" | ||
|
||
# Disable job control messages | ||
set +m | ||
|
||
# Background process to read from the named pipe and write to the log file | ||
cat "$fifo" | tee -a "$log_file_path" & | ||
cat_pid=$! | ||
|
||
# Dummy background process to keep the parent script running | ||
(while true; do sleep 1; done) & | ||
dummy_pid=$! | ||
|
||
kill_all() { | ||
kill $dummy_pid 2>/dev/null | ||
rm -f "$fifo" | ||
} | ||
|
||
# Check if running on WSL | ||
if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null ; then | ||
( | ||
trap 'kill_all' SIGINT SIGTERM EXIT | ||
sudo -E env "PATH=$PATH" keploy record > "$fifo" 2>&1 | ||
) | ||
else | ||
keploycmd="sudo -E env PATH=\"$PATH\" keploy" | ||
( | ||
trap 'kill_all' SIGINT SIGTERM EXIT | ||
eval $keploycmd record > "$fifo" 2>&1 | ||
) | ||
fi | ||
|
||
# Clean up: Wait for keploy command to finish | ||
wait $! |
Oops, something went wrong.