Lexical generator #93
  
    
      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 | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| jobs: | |
| lint: | |
| runs-on: self-hosted | |
| strategy: | |
| matrix: | |
| node-version: [22] | |
| pnpm-version: [10] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ matrix.pnpm-version }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| package-manager-cache: false | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm prisma generate | |
| - run: pnpm lint | |
| build: | |
| runs-on: self-hosted | |
| strategy: | |
| matrix: | |
| node-version: [22] | |
| pnpm-version: [10] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ matrix.pnpm-version }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| package-manager-cache: false | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm prisma generate | |
| - run: pnpm build | |
| test: | |
| runs-on: self-hosted | |
| strategy: | |
| matrix: | |
| node-version: [22] | |
| pnpm-version: [10] | |
| env: | |
| DATABASE_URL: mysql://dev:dev@localhost:3306/etuutt_test | |
| services: | |
| mariadb: | |
| image: mariadb:10 | |
| env: | |
| MYSQL_USER: 'dev' | |
| MYSQL_PASSWORD: 'dev' | |
| MYSQL_DATABASE: etuutt_test | |
| MYSQL_RANDOM_ROOT_PASSWORD: yes | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --name mariadb | |
| --health-cmd="mysqladmin ping" | |
| --health-interval=2s | |
| --health-timeout=2s | |
| --health-retries=10 | |
| --tmpfs /var/lib/mysql:rw | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ matrix.pnpm-version }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| package-manager-cache: false | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - run: cp .env.test.dist .env.test | |
| - run: pnpm test:db:reset | |
| - run: pnpm test:cov | |
| - uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| deploy: | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' | |
| runs-on: self-hosted | |
| needs: | |
| - lint | |
| - build | |
| - test | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install docker | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.REGISTRY_URL }} | |
| username: ${{ secrets.REGISTRY_USERNAME }} | |
| password: ${{ secrets.REGISTRY_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: | | |
| ${{ secrets.REGISTRY_URL }}/etuutt/api:${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }} |