chore(deps-dev): bump the npm-deps group across 1 directory with 3 updates #41
Workflow file for this run
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: TypeScript/Node.js CI | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x, 22.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Detect package manager | |
| id: detect | |
| run: | | |
| if [ -f "pnpm-lock.yaml" ]; then | |
| echo "pm=pnpm" >> $GITHUB_OUTPUT | |
| elif [ -f "yarn.lock" ]; then | |
| echo "pm=yarn" >> $GITHUB_OUTPUT | |
| elif [ -f "package-lock.json" ] || [ -f "package.json" ]; then | |
| echo "pm=npm" >> $GITHUB_OUTPUT | |
| else | |
| echo "pm=none" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Install pnpm | |
| if: steps.detect.outputs.pm == 'pnpm' | |
| run: npm install -g pnpm | |
| - name: Install dependencies | |
| if: steps.detect.outputs.pm != 'none' | |
| run: | | |
| if [ "${{ steps.detect.outputs.pm }}" == "pnpm" ]; then | |
| pnpm install || true | |
| elif [ "${{ steps.detect.outputs.pm }}" == "yarn" ]; then | |
| yarn install || true | |
| else | |
| npm install || true | |
| fi | |
| - name: Lint with ESLint | |
| continue-on-error: true | |
| if: steps.detect.outputs.pm != 'none' | |
| run: | | |
| if [ "${{ steps.detect.outputs.pm }}" == "pnpm" ]; then | |
| pnpm run lint || echo "::warning::ESLint found issues" | |
| elif [ "${{ steps.detect.outputs.pm }}" == "yarn" ]; then | |
| yarn lint || echo "::warning::ESLint found issues" | |
| else | |
| npm run lint || echo "::warning::ESLint found issues" | |
| fi | |
| - name: Type check with tsc | |
| continue-on-error: true | |
| if: steps.detect.outputs.pm != 'none' && hashFiles('tsconfig.json') != '' | |
| run: | | |
| if [ -f "tsconfig.json" ]; then | |
| npx tsc --noEmit || echo "::warning::TypeScript found type errors" | |
| else | |
| echo "::notice::No tsconfig.json found, skipping type checking" | |
| fi | |
| - name: Run tests | |
| if: steps.detect.outputs.pm != 'none' | |
| run: | | |
| if [ "${{ steps.detect.outputs.pm }}" == "pnpm" ]; then | |
| pnpm test -- --coverage || echo "::notice::No tests configured" | |
| elif [ "${{ steps.detect.outputs.pm }}" == "yarn" ]; then | |
| yarn test --coverage || echo "::notice::No tests configured" | |
| else | |
| npm test -- --coverage || echo "::notice::No tests configured" | |
| fi | |
| - name: Upload coverage to Codecov | |
| if: success() && hashFiles('coverage/lcov.info') != '' | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| flags: unittests | |
| name: codecov-${{ matrix.node-version }} | |
| - name: Build | |
| if: steps.detect.outputs.pm != 'none' | |
| run: | | |
| if [ "${{ steps.detect.outputs.pm }}" == "pnpm" ]; then | |
| pnpm run build || echo "::notice::No build script configured" | |
| elif [ "${{ steps.detect.outputs.pm }}" == "yarn" ]; then | |
| yarn build || echo "::notice::No build script configured" | |
| else | |
| npm run build || echo "::notice::No build script configured" | |
| fi |