...
This commit is contained in:
63
.github/workflows/hero_build_linux.yml
vendored
63
.github/workflows/hero_build_linux.yml
vendored
@@ -33,65 +33,8 @@ jobs:
|
|||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Vlang
|
- name: Setup V & Herolib
|
||||||
run: |
|
run: ./install_v.sh --herolib
|
||||||
git clone --depth=1 https://github.com/vlang/v
|
|
||||||
cd v
|
|
||||||
make
|
|
||||||
sudo ./v symlink
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
- name: Setup Herolib
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.vmodules/freeflowuniverse
|
|
||||||
ln -s $GITHUB_WORKSPACE/lib ~/.vmodules/freeflowuniverse/herolib
|
|
||||||
|
|
||||||
echo "Installing secp256k1..."
|
|
||||||
# Install build dependencies
|
|
||||||
sudo apt-get install -y build-essential wget autoconf libtool
|
|
||||||
|
|
||||||
# Download and extract secp256k1
|
|
||||||
cd /tmp
|
|
||||||
wget https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v0.3.2.tar.gz
|
|
||||||
tar -xvf v0.3.2.tar.gz
|
|
||||||
|
|
||||||
# Build and install
|
|
||||||
cd secp256k1-0.3.2/
|
|
||||||
./autogen.sh
|
|
||||||
./configure
|
|
||||||
make -j 5
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
rm -rf secp256k1-0.3.2 v0.3.2.tar.gz
|
|
||||||
|
|
||||||
echo "secp256k1 installation complete!"
|
|
||||||
|
|
||||||
- name: Install and Start Redis
|
|
||||||
run: |
|
|
||||||
# Import Redis GPG key
|
|
||||||
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
|
||||||
# Add Redis repository
|
|
||||||
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
|
|
||||||
# Install Redis
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y redis
|
|
||||||
|
|
||||||
# Start Redis
|
|
||||||
redis-server --daemonize yes
|
|
||||||
|
|
||||||
# Print versions
|
|
||||||
redis-cli --version
|
|
||||||
redis-server --version
|
|
||||||
|
|
||||||
- name: Build Hero
|
|
||||||
run: |
|
|
||||||
v -cg -enable-globals -w -n cli/hero.v
|
|
||||||
|
|
||||||
- name: Do all the basic tests
|
- name: Do all the basic tests
|
||||||
run: |
|
run: ./test_basic.vsh
|
||||||
./test_basic.vsh
|
|
||||||
env:
|
|
||||||
LIVEKIT_API_KEY: ${{secrets.LIVEKIT_API_KEY}}
|
|
||||||
LIVEKIT_API_SECRET: ${{secrets.LIVEKIT_API_SECRET}}
|
|
||||||
LIVEKIT_URL: ${{secrets.LIVEKIT_URL}}
|
|
||||||
|
|||||||
164
install_v.sh
164
install_v.sh
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
# Help function
|
# Help function
|
||||||
@@ -198,9 +197,9 @@ function os_update {
|
|||||||
echo 'builduser ALL=(ALL) NOPASSWD: ALL' | tee /etc/sudoers.d/builduser
|
echo 'builduser ALL=(ALL) NOPASSWD: ALL' | tee /etc/sudoers.d/builduser
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${DEBUG}" ]]; then
|
# if [[ -n "${DEBUG}" ]]; then
|
||||||
execute_with_marker "paru_install" paru_install
|
# execute_with_marker "paru_install" paru_install
|
||||||
fi
|
# fi
|
||||||
fi
|
fi
|
||||||
echo ' - os update done'
|
echo ' - os update done'
|
||||||
}
|
}
|
||||||
@@ -300,6 +299,28 @@ remove_all() {
|
|||||||
|
|
||||||
# Function to check if a service is running and start it if needed
|
# Function to check if a service is running and start it if needed
|
||||||
check_and_start_redis() {
|
check_and_start_redis() {
|
||||||
|
|
||||||
|
# Handle Redis installation for GitHub Actions environment
|
||||||
|
if is_github_actions; then
|
||||||
|
|
||||||
|
# Import Redis GPG key
|
||||||
|
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
||||||
|
# Add Redis repository
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
|
||||||
|
# Install Redis
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y redis
|
||||||
|
|
||||||
|
# Start Redis
|
||||||
|
redis-server --daemonize yes
|
||||||
|
|
||||||
|
# Print versions
|
||||||
|
redis-cli --version
|
||||||
|
redis-server --version
|
||||||
|
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Normal service management for non-container environments
|
# Normal service management for non-container environments
|
||||||
if [[ "${OSNAME}" == "ubuntu" ]] || [[ "${OSNAME}" == "debian" ]]; then
|
if [[ "${OSNAME}" == "ubuntu" ]] || [[ "${OSNAME}" == "debian" ]]; then
|
||||||
@@ -362,6 +383,74 @@ check_and_start_redis() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v-install() {
|
||||||
|
|
||||||
|
# Only clone and install if directory doesn't exist
|
||||||
|
if [ ! -d ~/code/v ]; then
|
||||||
|
echo "Installing V..."
|
||||||
|
mkdir -p ~/_code
|
||||||
|
cd ~/_code
|
||||||
|
git clone --depth=1 https://github.com/vlang/v
|
||||||
|
cd v
|
||||||
|
make
|
||||||
|
sudo ./v symlink
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify v is in path
|
||||||
|
if ! command_exists v; then
|
||||||
|
echo "Error: V installation failed or not in PATH"
|
||||||
|
echo "Please ensure ~/code/v is in your PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "V installation successful!"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
v-analyzer() {
|
||||||
|
|
||||||
|
# Install v-analyzer if requested
|
||||||
|
if [ "$INSTALL_ANALYZER" = true ]; then
|
||||||
|
echo "Installing v-analyzer..."
|
||||||
|
v download -RD https://raw.githubusercontent.com/vlang/v-analyzer/main/install.vsh
|
||||||
|
|
||||||
|
# Check if v-analyzer bin directory exists
|
||||||
|
if [ ! -d "$HOME/.config/v-analyzer/bin" ]; then
|
||||||
|
echo "Error: v-analyzer bin directory not found at $HOME/.config/v-analyzer/bin"
|
||||||
|
echo "Please ensure v-analyzer was installed correctly"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "v-analyzer installation successful!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add v-analyzer to PATH if installed
|
||||||
|
if [ -d "$HOME/.config/v-analyzer/bin" ]; then
|
||||||
|
V_ANALYZER_PATH='export PATH="$PATH:$HOME/.config/v-analyzer/bin"'
|
||||||
|
|
||||||
|
# Function to add path to rc file if not present
|
||||||
|
add_to_rc() {
|
||||||
|
local RC_FILE="$1"
|
||||||
|
if [ -f "$RC_FILE" ]; then
|
||||||
|
if ! grep -q "v-analyzer/bin" "$RC_FILE"; then
|
||||||
|
echo "" >> "$RC_FILE"
|
||||||
|
echo "$V_ANALYZER_PATH" >> "$RC_FILE"
|
||||||
|
echo "Added v-analyzer to $RC_FILE"
|
||||||
|
else
|
||||||
|
echo "v-analyzer path already exists in $RC_FILE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add to both .zshrc and .bashrc if they exist
|
||||||
|
add_to_rc ~/.zshrc
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ -f ~/.bashrc ]; then
|
||||||
|
add_to_rc ~/.bashrc
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Handle remove if requested
|
# Handle remove if requested
|
||||||
@@ -390,72 +479,15 @@ if [ "$RESET" = true ] || ! command_exists v; then
|
|||||||
# Install secp256k1
|
# Install secp256k1
|
||||||
install_secp256k1
|
install_secp256k1
|
||||||
|
|
||||||
# Only clone and install if directory doesn't exist
|
v-install
|
||||||
if [ ! -d ~/code/v ]; then
|
|
||||||
echo "Installing V..."
|
# Only install v-analyzer if not in GitHub Actions environment
|
||||||
mkdir -p ~/_code
|
if ! is_github_actions; then
|
||||||
cd ~/_code
|
v-analyzer
|
||||||
git clone --depth=1 https://github.com/vlang/v
|
|
||||||
cd v
|
|
||||||
make
|
|
||||||
sudo ./v symlink
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify v is in path
|
|
||||||
if ! command_exists v; then
|
|
||||||
echo "Error: V installation failed or not in PATH"
|
|
||||||
echo "Please ensure ~/code/v is in your PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "V installation successful!"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install v-analyzer if requested
|
|
||||||
if [ "$INSTALL_ANALYZER" = true ]; then
|
|
||||||
echo "Installing v-analyzer..."
|
|
||||||
v download -RD https://raw.githubusercontent.com/vlang/v-analyzer/main/install.vsh
|
|
||||||
|
|
||||||
# Check if v-analyzer bin directory exists
|
|
||||||
if [ ! -d "$HOME/.config/v-analyzer/bin" ]; then
|
|
||||||
echo "Error: v-analyzer bin directory not found at $HOME/.config/v-analyzer/bin"
|
|
||||||
echo "Please ensure v-analyzer was installed correctly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "v-analyzer installation successful!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add v-analyzer to PATH if installed
|
|
||||||
if [ -d "$HOME/.config/v-analyzer/bin" ]; then
|
|
||||||
V_ANALYZER_PATH='export PATH="$PATH:$HOME/.config/v-analyzer/bin"'
|
|
||||||
|
|
||||||
# Function to add path to rc file if not present
|
|
||||||
add_to_rc() {
|
|
||||||
local RC_FILE="$1"
|
|
||||||
if [ -f "$RC_FILE" ]; then
|
|
||||||
if ! grep -q "v-analyzer/bin" "$RC_FILE"; then
|
|
||||||
echo "" >> "$RC_FILE"
|
|
||||||
echo "$V_ANALYZER_PATH" >> "$RC_FILE"
|
|
||||||
echo "Added v-analyzer to $RC_FILE"
|
|
||||||
else
|
|
||||||
echo "v-analyzer path already exists in $RC_FILE"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add to both .zshrc and .bashrc if they exist
|
|
||||||
add_to_rc ~/.zshrc
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ -f ~/.bashrc ]; then
|
|
||||||
add_to_rc ~/.bashrc
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Final verification
|
|
||||||
if ! command_exists v; then
|
|
||||||
echo "Error: V is not accessible in PATH"
|
|
||||||
echo "Please add ~/code/v to your PATH and try again"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
check_and_start_redis
|
check_and_start_redis
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ lib/develop
|
|||||||
'
|
'
|
||||||
|
|
||||||
// the following tests have no prio and can be ignored
|
// the following tests have no prio and can be ignored
|
||||||
tests_ignore := '
|
mut tests_ignore := '
|
||||||
notifier_test.v
|
notifier_test.v
|
||||||
clients/meilisearch
|
clients/meilisearch
|
||||||
clients/zdb
|
clients/zdb
|
||||||
@@ -185,6 +185,10 @@ data/radixtree
|
|||||||
clients/livekit
|
clients/livekit
|
||||||
'
|
'
|
||||||
|
|
||||||
|
if os.exists("/home/runner"){
|
||||||
|
tests_ignore+="clients/livekit"
|
||||||
|
}
|
||||||
|
|
||||||
tests_error := '
|
tests_error := '
|
||||||
tmux_window_test.v
|
tmux_window_test.v
|
||||||
tmux_test.v
|
tmux_test.v
|
||||||
|
|||||||
97
workflows/hero_build_linux.yml
Normal file
97
workflows/hero_build_linux.yml
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
name: Build Hero on Linux & Run tests
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: x86_64-unknown-linux-musl
|
||||||
|
os: ubuntu-latest
|
||||||
|
short-name: linux-i64
|
||||||
|
# - target: aarch64-unknown-linux-musl
|
||||||
|
# os: ubuntu-latest
|
||||||
|
# short-name: linux-arm64
|
||||||
|
# - target: aarch64-apple-darwin
|
||||||
|
# os: macos-latest
|
||||||
|
# short-name: macos-arm64
|
||||||
|
# - target: x86_64-apple-darwin
|
||||||
|
# os: macos-13
|
||||||
|
# short-name: macos-i64
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
|
||||||
|
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
|
||||||
|
- run: echo "🔎 The name of your branch is ${{ github.ref_name }} and your repository is ${{ github.repository }}."
|
||||||
|
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Vlang
|
||||||
|
run: |
|
||||||
|
git clone --depth=1 https://github.com/vlang/v
|
||||||
|
cd v
|
||||||
|
make
|
||||||
|
sudo ./v symlink
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Setup Herolib
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.vmodules/freeflowuniverse
|
||||||
|
ln -s $GITHUB_WORKSPACE/lib ~/.vmodules/freeflowuniverse/herolib
|
||||||
|
|
||||||
|
echo "Installing secp256k1..."
|
||||||
|
# Install build dependencies
|
||||||
|
sudo apt-get install -y build-essential wget autoconf libtool
|
||||||
|
|
||||||
|
# Download and extract secp256k1
|
||||||
|
cd /tmp
|
||||||
|
wget https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v0.3.2.tar.gz
|
||||||
|
tar -xvf v0.3.2.tar.gz
|
||||||
|
|
||||||
|
# Build and install
|
||||||
|
cd secp256k1-0.3.2/
|
||||||
|
./autogen.sh
|
||||||
|
./configure
|
||||||
|
make -j 5
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm -rf secp256k1-0.3.2 v0.3.2.tar.gz
|
||||||
|
|
||||||
|
echo "secp256k1 installation complete!"
|
||||||
|
|
||||||
|
- name: Install and Start Redis
|
||||||
|
run: |
|
||||||
|
# Import Redis GPG key
|
||||||
|
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
||||||
|
# Add Redis repository
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
|
||||||
|
# Install Redis
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y redis
|
||||||
|
|
||||||
|
# Start Redis
|
||||||
|
redis-server --daemonize yes
|
||||||
|
|
||||||
|
# Print versions
|
||||||
|
redis-cli --version
|
||||||
|
redis-server --version
|
||||||
|
|
||||||
|
- name: Build Hero
|
||||||
|
run: |
|
||||||
|
v -cg -enable-globals -w -n cli/hero.v
|
||||||
|
|
||||||
|
- name: Do all the basic tests
|
||||||
|
run: |
|
||||||
|
./test_basic.vsh
|
||||||
|
env:
|
||||||
|
LIVEKIT_API_KEY: ${{secrets.LIVEKIT_API_KEY}}
|
||||||
|
LIVEKIT_API_SECRET: ${{secrets.LIVEKIT_API_SECRET}}
|
||||||
|
LIVEKIT_URL: ${{secrets.LIVEKIT_URL}}
|
||||||
@@ -3,9 +3,12 @@ name: Build Hero on Macos & Run tests
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
|
# Workflow is temporarily disabled. To enable, set ENABLE_MACOS_BUILD=true in repository secrets
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
if: ${{ vars.ENABLE_MACOS_BUILD == 'true' }}
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
if: ${{ vars.ENABLE_MACOS_BUILD == 'true' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
Reference in New Issue
Block a user