mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2026-08-08 23:54:01 -04:00
Compare commits
2
Commits
e0888c4d7c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d6d651e18 | ||
|
|
7583d6d179 |
@@ -1,5 +1,6 @@
|
||||
name: Builds
|
||||
run-name: Validate Node and Docker Builds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -9,15 +10,16 @@ jobs:
|
||||
Discord-Node-Build: # test if the node install and run
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 2
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node Environment lts/jod
|
||||
- name: Set up Node Environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/jod
|
||||
cache: "npm"
|
||||
cache: npm
|
||||
|
||||
- name: Install Project Dependencies
|
||||
run: |
|
||||
@@ -48,11 +50,11 @@ jobs:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node Environment lts/jod
|
||||
- name: Set up Node Environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/jod
|
||||
cache: "npm"
|
||||
cache: npm
|
||||
|
||||
- name: Create Environment Variables
|
||||
run: |
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
name: Coverage
|
||||
run-name: Code Coverage
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
Discord-Node-Coverage:
|
||||
runs-on: ubuntu-latest
|
||||
environment: coverage
|
||||
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
|
||||
|
||||
- name: Collect Code Coverage
|
||||
run: |
|
||||
LINE_PCT=$(npm run coverage | tail -2 | head -1 | awk '{print $3}')
|
||||
echo "COVERAGE=$LINE_PCT" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload Code Coverage
|
||||
uses: schneegans/dynamic-badges-action@v1.7.0
|
||||
with:
|
||||
auth: ${{ secrets.GIST_SECRET }}
|
||||
gistID: ${{ vars.GIST_ID }}
|
||||
filename: coverage.json
|
||||
label: Coverage
|
||||
message: ${{ env.COVERAGE }}
|
||||
valColorRange: ${{ env.COVERAGE }}
|
||||
maxColorRange: 100
|
||||
minColorRange: 0
|
||||
@@ -1,9 +1,6 @@
|
||||
name: Deploy
|
||||
run-name: Deploy Application Latest
|
||||
# on:
|
||||
# push:
|
||||
# tags:
|
||||
# - 'v*'
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
@@ -11,6 +8,7 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
environment: deploy
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -40,7 +38,7 @@ jobs:
|
||||
git clone https://github.com/kevinthedang/discord-ollama.git ${{ secrets.PATH }}
|
||||
cd ${{ secrets.PATH }}
|
||||
|
||||
- name: Install nvm and Node.js lts/jod
|
||||
- name: Install nvm and Node.js
|
||||
run: |
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
name: Tests
|
||||
run-name: Unit Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
@@ -21,15 +22,16 @@ 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
|
||||
- name: Set up Node Environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/jod
|
||||
cache: "npm"
|
||||
cache: npm
|
||||
|
||||
- name: Install Project Dependencies
|
||||
run: |
|
||||
|
||||
-10
@@ -37,16 +37,6 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
# Technical/Business Code Ownership
|
||||
/src/ @kevinthedang @JT2M0L3Y
|
||||
/tests/ @JT2M0L3Y
|
||||
/.github/ @kevinthedang
|
||||
/.github/ @kevinthedang @JT2M0L3Y
|
||||
|
||||
# Docker Ownership
|
||||
Dockerfile @kevinthedang
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
<p><a href="#"></a><a href="https://creativecommons.org/licenses/by/4.0/"><img alt="License" src="https://img.shields.io/badge/License-CC_BY_4.0-darkgreen.svg" /></a>
|
||||
<a href="#"></a><a href="https://github.com/kevinthedang/discord-ollama/releases/latest"><img alt="Release" src="https://img.shields.io/github/v/release/kevinthedang/discord-ollama?logo=github" /></a>
|
||||
<a href="#"></a><a href="https://github.com/kevinthedang/discord-ollama/actions/workflows/build.yml"><img alt="Builds" src="https://github.com/kevinthedang/discord-ollama/actions/workflows/build.yml/badge.svg" /></a>
|
||||
<!-- <a href="#"></a><a href="https://github.com/kevinthedang/discord-ollama/actions/workflows/deploy.yml"><img alt="Deploy Status" src="https://github.com/kevinthedang/discord-ollama/actions/workflows/deploy.yml/badge.svg" /></a> -->
|
||||
<a href="#"></a><a href="https://github.com/kevinthedang/discord-ollama/actions/workflows/test.yml"><img alt="Tests" src="https://github.com/kevinthedang/discord-ollama/actions/workflows/test.yml/badge.svg" /></a>
|
||||
<a href="#"></a><a href="https://github.com/kevinthedang/discord-ollama/actions/workflows/coverage.yml"><img alt="Code Coverage" src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kevinthedang/bc7b5dcfa16561ab02bb3df67a99b22d/raw/coverage.json"></a>
|
||||
</div>
|
||||
|
||||
## About/Goals
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ services:
|
||||
build: ./ # find docker file in designated path
|
||||
container_name: discord
|
||||
restart: always # rebuild container always
|
||||
image: kevinthedang/discord-ollama:0.9.0
|
||||
image: kevinthedang/discord-ollama:0.9.1
|
||||
environment:
|
||||
CLIENT_TOKEN: ${CLIENT_TOKEN}
|
||||
OLLAMA_IP: ${OLLAMA_IP}
|
||||
|
||||
Generated
+422
-1128
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"name": "discord-ollama",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"description": "Ollama Integration into discord",
|
||||
"main": "build/index.js",
|
||||
"exports": "./build/index.js",
|
||||
"scripts": {
|
||||
"tests": "vitest run",
|
||||
"coverage": "vitest run --coverage",
|
||||
"watch": "tsx watch src",
|
||||
"build": "tsc",
|
||||
"prod": "node .",
|
||||
@@ -32,7 +31,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.13.14",
|
||||
"@vitest/coverage-v8": "^3.0.9",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsx": "^4.19.3",
|
||||
"typescript": "^5.8.2",
|
||||
|
||||
+1
-2
@@ -18,9 +18,8 @@
|
||||
// Decompile .ts to .js into a folder named build
|
||||
"outDir": "build",
|
||||
"rootDir": "src",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["node_modules/"]
|
||||
"*": ["./node_modules/"]
|
||||
}
|
||||
},
|
||||
// environment for env vars
|
||||
|
||||
+2
-6
@@ -1,13 +1,9 @@
|
||||
import { defineConfig, configDefaults } from 'vitest/config'
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
// config for vitest
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true, // <-- reduces test file imports
|
||||
reporters: ['verbose'], // <-- verbose output
|
||||
coverage: {
|
||||
exclude: [...configDefaults.exclude, 'build/*', 'tests/*'], // <-- exclude JS build
|
||||
reporter: ['text-summary'] // <-- report in text-summary
|
||||
}
|
||||
reporters: ['verbose'] // <-- verbose output
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user