Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
44ccc30
test
okitamisan01 Sep 24, 2025
cd8303e
sprint3
okitamisan01 Oct 20, 2025
9bbbc7d
Backup before npm audit fix --force
okitamisan01 Oct 22, 2025
b697d87
unit_test_admin
okitamisan01 Oct 22, 2025
95c8252
finish admin unit test
okitamisan01 Oct 23, 2025
4529f5d
[FIX] activity.ts
okitamisan01 Oct 23, 2025
2694ea4
[FIX] activity.ts
okitamisan01 Oct 23, 2025
8660896
[START]github action
okitamisan01 Oct 27, 2025
858b454
[TEST]github action
okitamisan01 Oct 27, 2025
af0a40f
[TEST]github action
okitamisan01 Oct 27, 2025
9a0ada6
[TEST]github action
okitamisan01 Oct 27, 2025
55b182d
[CHANGE]enable githubaction in my branch
okitamisan01 Nov 3, 2025
b234daa
[CHENGE]fix file from Jared-Miller-testbranch
okitamisan01 Nov 3, 2025
a1595a0
[FIX]address error from Jared-Miller-testbranch
okitamisan01 Nov 3, 2025
0b60ee0
[TEST]test.yaml
okitamisan01 Nov 5, 2025
486dc28
[TEST]test.yaml
okitamisan01 Nov 5, 2025
35bb007
[TEST]test.yaml
okitamisan01 Nov 5, 2025
5d13bcd
[TEST]test.yaml
okitamisan01 Nov 5, 2025
2bc0748
[test]
okitamisan01 Nov 5, 2025
24b33b9
first commit
okitamisan01 Nov 6, 2025
f5d96f3
[test]
okitamisan01 Nov 6, 2025
7c55e71
autotest
okitamisan01 Nov 6, 2025
efffe81
[MILESTONE]Jest Test Work
okitamisan01 Nov 6, 2025
0725ea9
[MILESTONE]Jest Test Work
okitamisan01 Nov 6, 2025
532955f
[change]test.yml->dockerkmage.yaml
okitamisan01 Nov 6, 2025
03dede2
[change]add dockerimage into main
okitamisan01 Nov 6, 2025
5581179
[change]job name
okitamisan01 Nov 6, 2025
22fab48
[CHANGE]documentation into main
okitamisan01 Nov 6, 2025
48d4d6f
[CHANGE]automaticTest into main
okitamisan01 Nov 6, 2025
be5b461
[CHANGE]automaticTest into main
okitamisan01 Nov 6, 2025
5f2d6d2
give secrets
okitamisan01 Nov 10, 2025
87c6bc2
use kevin's docker account
okitamisan01 Nov 10, 2025
ec04a19
use kevin's docker account
okitamisan01 Nov 10, 2025
061af83
build image by using kevlund
okitamisan01 Nov 10, 2025
4be71c5
[MILESTONE]success in pushing docker image
okitamisan01 Nov 10, 2025
9d59d6d
[Make] documentation.yaml
okitamisan01 Nov 17, 2025
3b4d619
[Make] documentation.yaml
okitamisan01 Nov 17, 2025
5ca20e1
[Make] documentation.yaml
okitamisan01 Nov 17, 2025
58ec550
[Make] documentation.yaml
okitamisan01 Nov 17, 2025
e74a748
[Make] documentation.yaml
okitamisan01 Nov 17, 2025
74540ea
[Make] documentation.yaml
okitamisan01 Nov 17, 2025
50f2cf2
delete documenttaion
okitamisan01 Nov 19, 2025
46eb327
integration test
okitamisan01 Nov 19, 2025
0da9c2c
integration test
okitamisan01 Nov 19, 2025
ebf424d
poll commnad
okitamisan01 Nov 19, 2025
46e74d1
poll commnad
okitamisan01 Nov 19, 2025
bffc419
poll commnad
okitamisan01 Nov 19, 2025
c550561
[add]integration test
okitamisan01 Nov 19, 2025
dbd5bab
merged
jaredmiller219 Nov 19, 2025
4480515
ignore
jaredmiller219 Nov 30, 2025
aa5a7d9
adding names to authors on package.json, deleted testing.txt, need to…
jaredmiller219 Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/automaticTesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ on:
# - mizuho-githubaction # Run on pull request targeting `mizuho-githubaction` branch

jobs:
<<<<<<< HEAD
jest_test:
=======
unit_tests:
>>>>>>> origin/mizuho-integration
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest

Expand All @@ -25,8 +29,13 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
<<<<<<< HEAD
node-version: ">=18"
cache: "npm"
=======
node-version: '20'
cache: 'npm'
>>>>>>> origin/mizuho-integration

- name: Install required system dependencies
run: |
Expand All @@ -37,6 +46,68 @@ jobs:
run: |
npm cache clean --force
npm ci
<<<<<<< HEAD
=======

- name: Set config file
run: cp config.example.ts config.ts

- name: Show Jest config
run: npx jest --showConfig | sed -n '1,120p'

- name: Run Unit Tests
run: npx jest -c jest.config.js --no-cache --testPathIgnorePatterns=".*integration.*"

integration_tests:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: unit_tests

services:
mongodb:
image: mongo:5.0
env:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
ports:
- 27017:27017
options: >-
--health-cmd mongosh
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install required system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++

- name: Clean npm cache and install deps
run: |
npm cache clean --force
npm ci

- name: Set config file
run: cp config.example.ts config.ts

- name: Run Integration Tests
run: npx jest -c jest.config.js --no-cache --testMatch="**/*integration*.test.ts"
env:
MONGODB_URI: mongodb://test:test@localhost:27017/sage_test?authSource=admin
>>>>>>> origin/mizuho-integration

- name: Set config file
run: cp config.example.ts config.ts
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/dockerimage.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: dockerimage #name of the workflow

on:
<<<<<<< HEAD
workflow_call:
secrets:
=======
workflow_call:
secrets:
>>>>>>> origin/mizuho-integration
DOCKER_USER:
required: true
DOCKER_PASSWORD:
Expand All @@ -12,6 +17,7 @@ on:

jobs:
build-and-push:
<<<<<<< HEAD
# Build & push Docker image only on push events (not PRs) and after tests
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,3 +58,46 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=docker.io/kevlund/sage-repo:buildcache
cache-to: type=registry,ref=docker.io/kevlund/sage-repo:buildcache,mode=max
=======
# Build & push Docker image only on push events (not PRs) and after tests
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
# Ensure these secrets are defined in repository settings
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/kevlund/sage-repo
tags: |
type=raw,value=test-bot,enable=${{ github.ref == 'refs/heads/mizuho-githubaction' }}
type=sha,enable=true,format=long

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=docker.io/kevlund/sage-repo:buildcache
cache-to: type=registry,ref=docker.io/kevlund/sage-repo:buildcache,mode=max
>>>>>>> origin/mizuho-integration
40 changes: 40 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: documentation

on:
<<<<<<< HEAD
workflow_call:
=======
workflow_call:
>>>>>>> origin/mizuho-integration
# push:
# branches: [ "main", "Ava-branch-config", "mizuho-githubaction" ]

Expand All @@ -10,6 +14,42 @@ jobs:
runs-on: ubuntu-latest

steps:
<<<<<<< HEAD
- name: autodoc
run: echo "Not completed yet"
# run: npm run autodoc
=======
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++

- name: Build project
run: npm run build

- name: Generate documentation
run: npm run autodoc

- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: generated-docs
path: |
Commands.md
Staff Commands.md
retention-days: 30
>>>>>>> origin/mizuho-integration
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: Main Pipeline

on:
push:
<<<<<<< HEAD
branches: ["main"]
pull_request:
branches: ["main"]
=======
branches: [ "mizuho-integration" ]
pull_request:
branches: [ "mizuho-integration" ]
>>>>>>> origin/mizuho-integration

env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
Expand All @@ -16,6 +22,14 @@ permissions:
security-events: write
actions: read

<<<<<<< HEAD
=======
permissions:
contents: read
security-events: write
actions: read

>>>>>>> origin/mizuho-integration
jobs:
node:
uses: ./.github/workflows/node.js.yml
Expand All @@ -27,4 +41,8 @@ jobs:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
automaticTesting:
<<<<<<< HEAD
uses: ./.github/workflows/automaticTesting.yml
=======
uses: ./.github/workflows/automaticTesting.yml
>>>>>>> origin/mizuho-integration
22 changes: 22 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
<<<<<<< HEAD
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -20,6 +21,17 @@ jobs:
with:
node-version: ">=18"
cache: "npm"
=======
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
>>>>>>> origin/mizuho-integration

- name: Install required system dependencies
run: |
Expand All @@ -40,6 +52,7 @@ jobs:
if grep -q "node_modules/discord.js/typings/index.d.ts" build-output.log; then
echo "Ignoring build errors from node_modules/discord.js/typings/index.d.ts"

<<<<<<< HEAD
sed -i '/node_modules\/discord\.js\/typings\/index\.d\.ts/d' build-output.log
fi

Expand All @@ -55,6 +68,15 @@ jobs:

- name: Run tests (no cache)
run: npx jest -c jest.config.js --no-cache
=======
echo "No unignored build errors found. Workflow continues."

- name: Show Jest config
run: npx jest --showConfig | sed -n '1,120p'

- name: Run tests (no cache)
run: npx jest -c jest.config.js --no-cache
>>>>>>> origin/mizuho-integration

# - name: Start Development
# run: npm run dev
25 changes: 24 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# Define the Node version
ARG NODE_VERSION=24.4.0
ARG NODE_VERSION=20.18.3

# ─────────────────────────────────────────────────────────────
# Base image with Node and build tools
Expand Down Expand Up @@ -38,18 +38,35 @@ RUN npm ci --omit=dev
# Build stage (development + build)
FROM deps AS build

<<<<<<< HEAD
# Mount caching for npm to speed up subsequent installs
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
=======
# Install all dependencies including devDeps for build
RUN npm ci
>>>>>>> origin/mizuho-integration

# Copy the rest of the source code into the container
COPY . .

<<<<<<< HEAD
# Build the project
RUN npm run build

=======
# Ensure config.ts exists (fallback to example in CI/containers)
RUN test -f config.ts || cp config.example.ts config.ts

# Build the project
RUN npm run build

# Also include package.json in dist for module-alias '@root/package.json' resolution
RUN cp package.json dist/package.json

>>>>>>> origin/mizuho-integration
# ─────────────────────────────────────────────────────────────
# Final runtime stage (minimal image)
FROM base AS final
Expand All @@ -66,13 +83,19 @@ RUN apk add --no-cache \
# Run the application as a non-root user
USER node

<<<<<<< HEAD
# Copy package.json so package manager commands work
COPY package.json .

# Copy necessary files from previous stages
COPY --from=build /usr/src/app/package.json ./package.json
COPY --from=build /usr/src/app/package-lock.json ./package-lock.json
COPY --from=build /usr/src/app/tsconfig.json ./tsconfig.json
=======
# Copy necessary files from previous stages
COPY --from=build /usr/src/app/package.json ./package.json
COPY --from=build /usr/src/app/package-lock.json ./package-lock.json
>>>>>>> origin/mizuho-integration
COPY --from=deps /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/assets ./assets
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"sources": ["src/sage.ts"]
}
]
}
}
Loading