fix(deps): update dependency nanoid to v5 #8618
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: Node.js CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 0 * * 0" # weekly | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Node.js ${{ matrix.node-version }} | |
| strategy: | |
| matrix: | |
| node-version: [20.x, 22.x] | |
| env: | |
| DB_HOST: 127.0.0.1 | |
| DB_PORT: 3306 | |
| DB_USER: root | |
| DB_PASSWORD: root | |
| ENCRYPTION_KEY: b097b390a68441cc3bb151dd0171f25c3aabc688c50eeb26dc5e13254b333911 | |
| SESSION_KEY: a73545a5f08d2906e39a4438014200303f9269f3ade9227525ffb141294f1b62 | |
| DB_CONNECTION_LIMIT: 5 | |
| SERVER_FOOTER_NAME: BanManagement | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Cache Node.js modules and Next.js build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.npm | |
| ${{ github.workspace }}/.next/cache | |
| # Generate a new cache whenever packages or source files change | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
| # If source files changed but packages didn't, rebuild from a prior cache | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
| - run: npm ci | |
| - name: Set up MySQL | |
| run: | | |
| sudo systemctl start mysql.service | |
| sleep 5 && mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';" -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} | |
| mysql -e "SET GLOBAL sql_require_primary_key = ON;" -uroot | |
| - run: npm run lint | |
| - run: node --expose-gc ./node_modules/.bin/jest --coverage | |
| env: | |
| DB_PASSWORD: | |
| LOG_LEVEL: warn | |
| PORT: 3001 | |
| - name: Setup E2E database | |
| run: node cypress/setup.js | |
| env: | |
| DB_PASSWORD: | |
| DB_NAME: bm_e2e_tests | |
| - name: Build for E2E | |
| run: npm run build | |
| env: | |
| DB_PASSWORD: | |
| DB_NAME: bm_e2e_tests | |
| NODE_ENV: production | |
| - name: Cypress run | |
| uses: cypress-io/github-action@v6 | |
| env: | |
| DB_PASSWORD: | |
| DB_NAME: bm_e2e_tests | |
| LOG_LEVEL: warn | |
| PORT: 3000 | |
| NODE_ENV: production | |
| CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CYPRESS_PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
| CONTACT_EMAIL: "admin@banmanagement.com" | |
| NOTIFICATION_VAPID_PUBLIC_KEY: ${{ secrets.NOTIFICATION_VAPID_PUBLIC_KEY }} | |
| NOTIFICATION_VAPID_PRIVATE_KEY: ${{ secrets.NOTIFICATION_VAPID_PRIVATE_KEY }} | |
| with: | |
| install: false | |
| start: npm start | |
| wait-on: "http://127.0.0.1:3000" | |
| record: true | |
| - name: Coveralls Parallel | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| flag-name: run-${{ matrix.test_number }} | |
| parallel: true | |
| build_docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker build . # TODO cache | |
| finish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Coveralls Finished | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| parallel-finished: true |