npm: bump prettier from 3.7.4 to 3.8.0 (#10) #119
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| jobs: | |
| # Lint and format check | |
| lint: | |
| name: Lint & Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "25" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npm run lint | |
| - name: Check formatting | |
| run: npm run format -- --check | |
| # Run tests | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| mariadb: | |
| image: mariadb:latest | |
| env: | |
| MARIADB_ROOT_PASSWORD: testpassword | |
| MARIADB_DATABASE: server_api_test | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="healthcheck.sh --connect --innodb_initialized" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| redis: | |
| image: redis:8-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 25 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Wait for MariaDB | |
| run: | | |
| sudo apt-get install -y mariadb-client | |
| until mariadb -h 127.0.0.1 -u root -ptestpassword -e "SELECT 1" &> /dev/null; do | |
| echo 'waiting for mariadb...' | |
| sleep 2 | |
| done | |
| - name: Setup database | |
| run: mariadb -h 127.0.0.1 -u root -ptestpassword server_api_test < db/schema.sql | |
| - name: Run tests | |
| run: npm test | |
| env: | |
| NODE_ENV: test | |
| DB_HOST: 127.0.0.1 | |
| DB_USER: root | |
| DB_PASSWORD: testpassword | |
| DB_NAME: server_api_test | |
| REDIS_ENABLED: true | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: 6379 | |
| # Security audit | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 25 | |
| - name: Run npm audit | |
| run: npm audit --audit-level=moderate | |
| continue-on-error: true |