name: Nodejs CI

# The workflow was triggered 210 times via automatically.

on:
  # schedule:
  # - cron: '12 17 * * 1'
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [20.x, 22.x, 24.x]

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm install, build, and test
      run: |
        cat /etc/*release
        grep MH /proc/cpuinfo
        free -h
        curl https://inet-ip.info/ip
        dig jsx.jp
        dig proxy.secure.jsx.jp
        dig gcp.jsx.jp
        dig aws.jsx.jp
        npm i
        npm run build --if-present
        npm run lint --if-present
        docker run --rm -p 3128:3128 -d ghcr.io/jobscale/squid
        npm test
      env:
        CI: true
