-
Notifications
You must be signed in to change notification settings - Fork 3
add: ciの追加 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add: ciの追加 #8
Changes from all commits
90dd079
00f117e
53cf361
1e74ee4
de61135
0c99d86
a044867
a96c6fc
53ad582
4585e8d
34b4d29
438679a
3dea21f
359c8ef
a7a71f1
d8e8bbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [24.x] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Format check | ||
| run: npm run format:check | ||
|
|
||
| - name: Type check | ||
| run: npm run typecheck | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Docker build test | ||
| run: docker compose build | ||
|
|
||
| - name: Create test settings.json | ||
| run: cp src/settings.json.sample src/settings.json | ||
|
|
||
| - name: Docker run test (expect TokenInvalid error) | ||
| run: | | ||
| # コンテナを起動し、TokenInvalidエラーが出ることを確認 | ||
| set +e | ||
| timeout 15s docker compose up > docker-logs.txt 2>&1 | ||
| EXIT_CODE=$? | ||
| set -e | ||
|
|
||
| # ログを表示 | ||
| echo "=== Docker logs ===" | ||
| cat docker-logs.txt | ||
| echo "==================" | ||
|
|
||
| # コンテナを停止 | ||
| docker compose down | ||
|
|
||
| # TokenInvalidエラーログが出力されているか確認 | ||
| if grep -q "TokenInvalid" docker-logs.txt; then | ||
| echo "✓ Docker container successfully started and reached Discord login" | ||
| exit 0 | ||
| else | ||
| echo "✗ Container did not reach expected state" | ||
| exit 1 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| dist/ | ||
| node_modules/ | ||
| .eslintrc.json | ||
| .env | ||
| settings.json | ||
| settings.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| node_modules | ||
| dist | ||
| *.log | ||
| .git | ||
| coverage | ||
| build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "semi": true, | ||
| "trailingComma": "es5", | ||
| "singleQuote": false, | ||
| "printWidth": 80, | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "endOfLine": "lf", | ||
| "arrowParens": "avoid" | ||
| } | ||
Mikuto0831 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 別PRにするなら,このPRではこのファイル消しませんか |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| const eslint = require('@eslint/js'); | ||
| const tseslint = require('@typescript-eslint/eslint-plugin'); | ||
| const tsparser = require('@typescript-eslint/parser'); | ||
| const prettier = require('eslint-config-prettier'); | ||
| const globals = require('globals'); | ||
|
|
||
| module.exports = [ | ||
| eslint.configs.recommended, | ||
| { | ||
| files: ['src/**/*.ts'], | ||
| languageOptions: { | ||
| parser: tsparser, | ||
| parserOptions: { | ||
| ecmaVersion: 2021, | ||
| sourceType: 'module', | ||
| project: './tsconfig.json', | ||
| }, | ||
| globals: { | ||
| ...globals.node, | ||
| NodeJS: 'readonly', | ||
| }, | ||
| }, | ||
| plugins: { | ||
| '@typescript-eslint': tseslint, | ||
| }, | ||
| rules: { | ||
| ...tseslint.configs['flat/recommended-type-checked'].rules, | ||
| '@typescript-eslint/no-explicit-any': 'warn', | ||
| 'no-unused-vars': 'off', // TypeScript ESLintのno-unused-varsを使うため無効化 | ||
| '@typescript-eslint/no-unused-vars': [ | ||
| 'warn', | ||
| { | ||
| argsIgnorePattern: '^_', | ||
| varsIgnorePattern: '^_', | ||
| }, | ||
| ], | ||
| '@typescript-eslint/no-non-null-assertion': 'off', | ||
| 'no-console': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| ignores: ['dist/**', 'node_modules/**', '*.js', '!eslint.config.js'], | ||
| }, | ||
| prettier, | ||
| ]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,19 @@ | |
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "build": "tsc", | ||
| "start": "node dist/main.js", | ||
| "format": "prettier --write 'src'" | ||
| "fmt": "prettier --write \"src/**/*.ts\"", | ||
| "format": "prettier --write \"src/**/*.ts\"", | ||
| "format:check": "prettier --check \"src/**/*.ts\"", | ||
| "typecheck": "tsc --noEmit" | ||
| }, | ||
| "engines": { | ||
| "node": "24.x" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "devDependencies": { | ||
| "devDependencies": { | ||
| "@eslint/js": "^9.4.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 別PRにするなら devDependencies の更新はしなくていいんじゃないすか |
||
| "@typescript-eslint/eslint-plugin": "^8.46.4", | ||
| "@typescript-eslint/parser": "^8.46.4", | ||
| "eslint": "^9.4.0", | ||
|
|
@@ -24,6 +28,7 @@ | |
| "eslint-plugin-import": "^2.29.1", | ||
| "eslint-plugin-n": "^17.6.0", | ||
| "eslint-plugin-promise": "^7.2.1", | ||
| "globals": "^16.5.0", | ||
| "prettier": "^3.3.2", | ||
| "ts-node": "^10.9.2", | ||
| "ts-node-dev": "^2.0.0", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.