mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2025-12-12 11:56:06 -05:00
* Update: simplify npm command to run tests * Fix: redis workaround for local non docker * Update: error message and config creation * Fix: Better Messages for Ollama service being offline * Update: version increment * Fix: verion typo * Update: Use built-in catch method for logging * Update: same catch method for redis
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Tests
|
|
run-name: Unit Tests
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- '*'
|
|
- 'package*.json'
|
|
- 'src/**'
|
|
- 'tests/**'
|
|
- '!docs/**'
|
|
- '!imgs/**'
|
|
- '!.github/**'
|
|
- '.github/workflows/**'
|
|
- '!.gitignore'
|
|
- '!LICENSE'
|
|
- '!README'
|
|
|
|
jobs:
|
|
Discord-Node-Test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 2
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node Environment lts/jod
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/jod
|
|
cache: "npm"
|
|
|
|
- name: Install Project Dependencies
|
|
run: |
|
|
npm install
|
|
|
|
- name: Create Environment Variables
|
|
run: |
|
|
touch .env
|
|
echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env
|
|
echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env
|
|
echo OLLAMA_PORT = ${{ secrets.OLLAMA_PORT }} >> .env
|
|
echo MODEL = ${{ secrets.MODEL }} >> .env
|
|
echo REDIS_IP = ${{ secrets.REDIS_IP }} >> .env
|
|
echo REDIS_PORT = ${{ secrets.REDIS_PORT }} >> .env
|
|
|
|
- name: Test Application
|
|
run: |
|
|
npm run tests
|