name: Node.js Test

on:
  push:
    branches: [ main ]
  pull_request:

jobs:
  test:
    name: Test Node.js
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16.x'

      - name: Check Node.js version
        run: node --version

      - name: Create simple script
        run: |
          echo 'console.log("Hello from Node.js!");' > test.js
          echo 'console.log(`Node.js version: ${process.version}`);' >> test.js

      - name: Run Node.js script
        run: node test.js 