test 2 #3
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 | |
- name: Checkout cloud-sdk-js for License Check | |
uses: actions/checkout@v4 | |
with: | |
repository: sap/cloud-sdk-js | |
path: cloud-sdk-js | |
- name: Run License Check | |
run: node --loader ts-node/esm cloud-sdk-js/scripts/check-licenses.ts | |
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}} |