name: Node.js CI on: push: branches: [ master ] paths-ignore: - '*.md' # ignore changes to readmes pull_request: branches: [ master ] jobs: test: runs-on: ubuntu-latest if: github.actor != 'mtcute-bot' # do not run after release strategy: matrix: node-version: [18.x, 20.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Setup pnpm uses: pnpm/action-setup@v2 with: version: 8 - run: pnpm install --frozen-lockfile - name: 'TL codegen' run: pnpm -C packages/tl run gen-code - name: 'TypeScript' run: pnpm run lint:tsc:ci - name: 'ESLint' run: pnpm run lint:ci - name: 'Circular dependencies' run: pnpm run lint:dpdm - run: pnpm run test:ci - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 if: ${{ matrix.node-version == '18.x' }} # to avoid uploading twice env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: files: ./coverage/coverage-final.json e2e: runs-on: ubuntu-latest needs: test steps: - uses: actions/checkout@v4 - name: Run end-to-end tests env: API_ID: ${{ secrets.TELEGRAM_API_ID }} API_HASH: ${{ secrets.TELEGRAM_API_HASH }} run: cd e2e && ./cli.sh ci