stuff #7
This file contains 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: build | |
on: | |
push: | |
branches: ['main'] | |
pull_request: ~ | |
workflow_dispatch: ~ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: ${{ fromJSON(vars.SUPPORTED_NODE_VERSIONS) }} | |
steps: | |
- uses: sap/ai-sdk-js/.github/actions/setup@main | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: pnpm test:unit | |
- run: pnpm test:type | |
- run: pnpm test:schema | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: sap/ai-sdk-js/.github/actions/setup@main | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v4 | |
- run: pnpm lint | |
- name: Check CommonJS compatibility | |
run: pnpm compile:cjs | |
- name: Check public API | |
run: pnpm check:public-api | |
- name: Check dependencies | |
run: pnpm check:deps | |
- name: Check License | |
uses: shibeshduw/ai-sdk-js/.github/actions/check-license@main | |
dependabot: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} | |
needs: [test, checks] | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/[email protected] | |
with: | |
github-token: '${{ secrets.GITHUB_TOKEN }}' | |
- name: Approve a PR | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Enable auto-merge for Dependabot PRs | |
run: gh pr merge --auto --squash "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |