name: OSX
on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main
jobs:
  build:
    runs-on: macos-latest
    steps:
    - name: Harden Runner
      uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
      with:
        egress-policy: audit
    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
    - name: Use Node.js
      uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
      with:
        node-version: '24.x'
    - name: Install dependencies
      run: npm ci
    - name: Test 3g
      run: bin/index.js 3g && bin/index.js stop
    - name: Test configuration
      run: bin/index.js throttle --up 330 --down 780 --rtt 200 && bin/index.js stop
    - name: Test localhost
      run: bin/index.js throttle --rtt 200 --localhost && bin/index.js stop --localhost
    - name: Test profile and packet loss
      run: bin/index.js 3g --packetLoss 5 && bin/index.js stop
    - name: Test configuration  and packet loss
      run: bin/index.js throttle --up 330 --down 780 --rtt 200 --packetLoss 5 && bin/index.js stop
