Add GitHub Actions release workflows for npm packages #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: langchainjs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "integrations/langchainjs/**" | |
| - ".github/workflows/langchainjs.yml" | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| paths: | |
| - "integrations/langchainjs/**" | |
| - ".github/workflows/langchainjs.yml" | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| working-directory: integrations/langchainjs | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| name: "test (node: ${{ matrix.node-version }})" | |
| strategy: | |
| matrix: | |
| node-version: ["18", "20", "22"] | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: rm -f package-lock.json && npm install | |
| - name: Run tests | |
| run: npm run test | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: lint | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: rm -f package-lock.json && npm install | |
| - name: Run linter | |
| run: npm run lint | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: typecheck | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: rm -f package-lock.json && npm install | |
| - name: Run typecheck | |
| run: npm run typecheck | |
| format: | |
| runs-on: ubuntu-latest | |
| name: format | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: rm -f package-lock.json && npm install | |
| - name: Check formatting | |
| run: npm run format:check | |
| build: | |
| runs-on: ubuntu-latest | |
| name: build | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: rm -f package-lock.json && npm install | |
| - name: Build package | |
| run: npm run build | |
| - name: Check package exports | |
| run: npm run check-package |