Skip to content

Update opentelemetry-js-contrib monorepo (#530) #579

Update opentelemetry-js-contrib monorepo (#530)

Update opentelemetry-js-contrib monorepo (#530) #579

name: Test Integration
env:
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: 'http://${{ secrets.PARENT_DOMAIN }}:4318/v1/metrics'
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: 'http://${{ secrets.PARENT_DOMAIN }}:4318/v1/logs'
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://${{ secrets.PARENT_DOMAIN }}:4318/v1/traces'
on:
push:
branches: main
paths:
- '**/package.json'
- '**/pyproject.toml'
- '**/*.gemspec'
- '**/version.txt'
- '**/Dockerfile'
- '.github/workflows/test_integration.yml'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
concurrency:
group: test-integration
jobs:
observe:
runs-on: ubuntu-latest
steps:
- uses: plengauer/opentelemetry-bash/actions/instrument/[email protected]
with:
cache: true
test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: "Setup observability"
uses: plengauer/opentelemetry-bash/actions/instrument/[email protected]
with:
cache: true
- name: "Prepare system"
run: |
sudo apt-get update
sudo apt-get -y remove ufw containerd.io docker-ce-cli
- name: "Install bot"
env:
PHILBOT_APPLICATION_ID: ${{ secrets.PHILBOT_APPLICATION_ID }}
PHILBOT_API_TOKEN: ${{ secrets.PHILBOT_API_TOKEN }}
PHILBOT_YOUTUBE_API_TOKEN: ${{ secrets.YOUTUBE_API_TOKEN }}
PHILBOT_OPENAI_API_TOKEN: ${{ secrets.OPENAI_API_TOKEN }}
run: |
sudo apt-get install -y debconf-utils jq curl wget
{
echo philbot-config philbot/DEPLOYMENT select staging
echo philbot-config philbot/DISCORD_CLIENT_ID string $PHILBOT_APPLICATION_ID
echo philbot-config philbot/DISCORD_API_TOKEN string $PHILBOT_API_TOKEN
echo philbot-config philbot/SELF_MONITORING select yes
echo philbot-config philbot/OWNER_DISCORD_USER_ID string 305778551167254529
echo philbot-config philbot/YOUTUBE_API_TOKEN string $PHILBOT_YOUTUBE_API_TOKEN
echo philbot-config philbot/OPENAI_API_TOKEN string $PHILBOT_OPENAI_API_TOKEN
echo philbot-config philbot/OPENAI_COST_LIMIT string 1
} | sudo debconf-set-selections
wget -O - https://raw.githubusercontent.com/plengauer/philbot/main/INSTALL.sh | sh
- name: "Scale bot"
run: |
sleep $((60 * 5)) # let it scale
sleep 60 # let it boot up
- name: "Test Webserver"
run: wget http://127.0.0.1:8080/
- name: "Test AI"
env:
PHILBOT_APPLICATION_ID: ${{ secrets.PHILBOT_APPLICATION_ID }}
PHILBOT_API_TOKEN: ${{ secrets.PHILBOT_API_TOKEN }}
CHANNEL_ID: ${{ secrets.PHILBOT_TEXT_CHANNEL_ID }}
run: |
message_id="$(curl -H "authorization: Bot $PHILBOT_API_TOKEN" -H 'content-type: application/json' -d "{\"content\": \"@self hello, how are you?\"}" https://discord.com/api/v10/channels/$CHANNEL_ID/messages | jq -r .id)"
while ! curl -H "authorization: Bot $PHILBOT_API_TOKEN" https://discord.com/api/v10/channels/$CHANNEL_ID/messages | jq -r .[].referenced_message.id | grep -F "$message_id"; do sleep 10; done
# - name: "Test Voice"
# env:
# PHILBOT_APPLICATION_ID: ${{ secrets.PHILBOT_APPLICATION_ID }}
# PHILBOT_API_TOKEN: ${{ secrets.PHILBOT_API_TOKEN }}
# GUILD_ID: ${{ secrets.PHILBOT_GUILD_ID }}
# TEXT_CHANNEL_ID: ${{ secrets.PHILBOT_TEXT_CHANNEL_ID }}
# VOICE_CHANNEL_ID: ${{ secrets.PHILBOT_VOICE_CHANNEL_ID }}
# run: |
# voice_channel_name="$(curl -H "authorization: Bot $PHILBOT_API_TOKEN" https://discord.com/api/v10/channels/$VOICE_CHANNEL_ID | jq -r .name)"
# echo '{"value":"true"}' | sudo tee /var/lib/philbot/memory/config_feature_guild_"$GUILD_ID"_name_player.json > /dev/null
# message_id="$(curl -H "authorization: Bot $PHILBOT_API_TOKEN" -H 'content-type: application/json' -d "{\"content\": \"@self play in $voice_channel_name Rick Astley Never Gonna Give You Up\"}" https://discord.com/api/v10/channels/$TEXT_CHANNEL_ID/messages | jq -r .id)"
# while ! ls /var/lib/philbot/memory/player_voice_channel_guild_"$GUILD_ID".json; do sleep 1; done
# while ! ls /var/lib/philbot/memory/voice_channel_user_"$PHILBOT_APPLICATION_ID".json; do sleep 1; done
# sleep 60
# while ! ls /var/lib/philbot/memory/voice_channel_user_"$PHILBOT_APPLICATION_ID".json; do sleep 1; done
# while ls /var/lib/philbot/memory/voice_channel_user_"$PHILBOT_APPLICATION_ID".json; do sleep 1; done
- name: "Uninstall bot"
run: |
sudo apt-get -y remove philbot
sudo apt-get -y auto-remove
sudo apt-get -y auto-clean