Remove usage controller and model, and update query service to elimin… #496
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: Backend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - run: npm ci | |
| working-directory: ./backend | |
| - run: npm run build | |
| working-directory: ./backend | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend | |
| path: ./backend/dist | |
| run: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| services: | |
| mongodb: | |
| image: mongo:latest | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --eval 'db.adminCommand(\"ping\")'" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| MONGODB_URI: mongodb://localhost:27017 | |
| PORT: 3000 | |
| GITHUB_APP_ID: ${{ secrets.APP_ID }} | |
| GITHUB_APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | |
| GITHUB_WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }} | |
| strategy: | |
| matrix: | |
| node-version: ['18', '20', '22'] | |
| name: Node v${{ matrix.node-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - run: npm ci | |
| working-directory: ./backend | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: backend | |
| path: ./backend/dist | |
| - run: | | |
| npm start & | |
| sleep 30 | |
| kill $! | |
| working-directory: ./backend | |
| timeout-minutes: 1 |