diff --git a/.github/workflows/npmbuildonpullrequest.yml b/.github/workflows/npmbuildonpullrequest.yml new file mode 100644 index 0000000000..0b6f303518 --- /dev/null +++ b/.github/workflows/npmbuildonpullrequest.yml @@ -0,0 +1,44 @@ +name: NPM Build on PR Open + +on: + pull_request: + types: [opened, synchronize] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16, 20] + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Log GitHub event + run: | + echo "PR head ref: ${{ github.event.pull_request.head.ref }}" + echo "PR head sha: ${{ github.event.pull_request.head.sha }}" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Log Node.js and npm versions + run: | + echo "Node.js version: $(node --version)" + echo "npm version: $(npm --version)" + + - name: Install dependencies + run: | + echo "Installing dependencies..." + npm install + echo "Dependencies installed." + + - name: Run build + run: | + echo "Running build..." + npm run build + echo "Build completed."