diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27a0ef6..90c239c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,40 @@ -on: [push, pull_request] name: Build & Test +on: [push, pull_request] jobs: test: - runs-on: ubuntu-latest + env: + PUPPETEER_SKIP_DOWNLOAD: "1" strategy: fail-fast: false matrix: - node-version: [8.x, 10.x, 12.x, 14.x] + node-version: [18.x, 20.x, lts/*, current] + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6.3.0 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: | + npm install --no-progress + - name: Run lint and node tests + run: | + npm config set script-shell bash + npm run lint && npm run test:node + + browser-test: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Build - run: npm install - - name: Test - run: npm test + - name: Checkout repository + uses: actions/checkout@v6 + - name: Use Node.js lts/* + uses: actions/setup-node@v6.3.0 + with: + node-version: lts/* + - name: Install dependencies + run: npm install --no-progress + - name: Run browser tests + run: npm run test:browser diff --git a/.gitignore b/.gitignore index b3f240e..8e1078d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .nyc_output coverage/ +package-lock.json diff --git a/package.json b/package.json index a5ca532..76f923e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "test:node": "hundreds mocha test/test.js", "test:browser": "node -e 'process.exit(process.version.startsWith(\"v8.\") ? 0 : 1)' || polendina --cleanup --runner=mocha test/test.js", + "test:ci": "npm run lint && npm run test:node && npm run test:browser", "test": "npm run lint && npm run test:node && npm run test:browser", "lint": "standard", "coverage": "c8 --reporter=text --reporter=html mocha test/test.js && npx st -d coverage -p 8888"