Update liability clause to reflect Musicify branding #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x] | |
| steps: | |
| - name: Checkout repository | |
| 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: Syntax check all source files | |
| run: | | |
| for file in $(find src -name "*.js" | sort); do | |
| echo "Checking $file..." | |
| node -c "$file" | |
| done | |
| echo "All files passed syntax check." | |
| - name: Validate command structure | |
| run: | | |
| node -e " | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const commandsDir = path.resolve('src/commands'); | |
| const files = fs.readdirSync(commandsDir).filter(f => f.endsWith('.js')); | |
| let ok = true; | |
| for (const file of files) { | |
| const content = fs.readFileSync(path.resolve(commandsDir, file), 'utf-8'); | |
| const hasData = /\bdata\s*[:=]/.test(content); | |
| const hasExecute = /async\s+execute\b|\.execute\s*=/.test(content); | |
| if (!hasData) { | |
| console.error('FAIL: ' + file + ' — missing \"data\"'); | |
| ok = false; | |
| } | |
| if (!hasExecute) { | |
| console.error('FAIL: ' + file + ' — missing \"execute\"'); | |
| ok = false; | |
| } | |
| if (hasData && hasExecute) { | |
| const name = content.match(/setName\(['\"](\w+)['\"]\)/); | |
| console.log('OK: ' + file + (name ? ' — /' + name[1] : '')); | |
| } | |
| } | |
| if (!ok) process.exit(1); | |
| console.log('All ' + files.length + ' commands validated.'); | |
| " |