Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy authored Dec 10, 2023
2 parents d294942 + eca4fec commit 497aa0c
Show file tree
Hide file tree
Showing 72 changed files with 20,586 additions and 27,256 deletions.
3 changes: 1 addition & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node >= 12
node >= 14
last 2 Chrome versions
last 2 Edge versions
last 2 Firefox versions
Expand All @@ -9,4 +9,3 @@ unreleased Edge versions
unreleased Firefox versions
unreleased Safari versions
unreleased Opera versions
IE 11
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
coverage/
mocha.js
mocha.js.map
mocha-es2018.js
*.fixture.js
docs/_site
docs/api
docs/_dist
docs/example
out/
!bin/mocha.js
!lib/mocha.js
test/integration/fixtures
!.*.js
Expand Down
1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ overrides:
- files:
- lib/nodejs/esm-utils.js
- rollup.config.js
- rollup_no-ie11.config.js
- scripts/pick-from-package-json.js
parserOptions:
ecmaVersion: 2018
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'run-browser-test')
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 14
- uses: actions/checkout@v2
node-version: lts/*
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: 'Cache node_modules'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: '~/.npm'
key: "ubuntu-latest-node-full-v14-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-full-v14-
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
- name: Install Dependencies
run: npm ci
- name: Run Browser Tests
Expand All @@ -33,7 +32,7 @@ jobs:
SAUCE_USERNAME: '${{secrets.SAUCE_USERNAME}}'
SAUCE_ACCESS_KEY: '${{secrets.SAUCE_ACCESS_KEY}}'
- name: remove 'run-browser-test' label
uses: buildsville/add-remove-label@v1
uses: buildsville/add-remove-label@v2.0.0
if: ${{ always() }}
with:
token: ${{secrets.GITHUB_TOKEN}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/delete-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
inputs:
days:
description: 'Number of days'
type: number
required: true
default: 180

Expand Down
210 changes: 106 additions & 104 deletions .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,56 @@ on:
push:
branches:
- '**'
- '!mochajs.org'
paths-ignore: ['*.md', 'docs/**']
tags-ignore:
- '**'
pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
paths-ignore: ['*.md', 'docs/**']

jobs:
prevent-run-twice:
name: Prevent to run twice
prevent-double-run:
# skip 'push' event when an open PR exists
name: Prevent double run
runs-on: ubuntu-latest
# Run 'pull-request' event only on external PRs from forked repos.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
outputs:
pr-id: ${{ steps.findPr.outputs.number }}
steps:
- run: 'echo run Tests'
- name: Check event pull_request
if: github.event_name == 'pull_request'
run: 'echo pull_request: run workflow'
- uses: actions/checkout@v4
if: github.event_name == 'push'
with:
persist-credentials: false
- name: Check event push
id: findPr
if: github.event_name == 'push'
uses: jwalton/gh-find-current-pr@v1
with:
state: open

smoke:
name: 'Smoke [Node.js v${{ matrix.node }} / ${{ matrix.os }}]'
needs: prevent-run-twice
needs: prevent-double-run
if: needs.prevent-double-run.outputs.pr-id == ''
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-latest
- windows-2019
node:
- 12
- 14
- 16
- 17
- 18
- 20
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '${{ matrix.node }}'
- run: npm install --production
Expand All @@ -46,17 +63,17 @@ jobs:
runs-on: ubuntu-latest
needs: smoke
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/checkout@v4
with:
node-version: 16
- uses: actions/checkout@v2
persist-credentials: false
- name: 'Cache node_modules'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: '~/.npm'
key: "ubuntu-latest-node-v16-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-v16-
key: "ubuntu-latest-node-lts-${{ hashFiles('**/package-lock.json') }}"
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: 'Check lint'
Expand All @@ -74,85 +91,32 @@ jobs:
- ubuntu-latest
- windows-2019
node:
- 12
- 14
- 16
- 17
- 18
- 20
include:
- os: ubuntu-latest
node: 16
env:
COVERAGE: 1
steps:
# - name: Cache Growl Installer (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# id: cache-growl
# uses: actions/cache@v2
# with:
# path: GrowlInstaller
# key: '${{ runner.os }}-growl-installer'
# restore-keys: |
# ${{ runner.os }}-growl-installer
# - name: Download Growl Installer (Windows)
# if: "${{ matrix.os == 'windows-2019' && steps.cache-growl.outputs.cache-hit != 'true'}}"
# run: >
# echo "Downloading Growl installer..."

# mkdir GrowlInstaller | out-null

# $seaURL =
# "https://github.com/briandunnington/growl-for-windows/releases/download/final/GrowlInstaller.exe"

# $seaPath = "GrowlInstaller\GrowlInstaller.exe"

# $webclient = New-Object Net.WebClient

# $webclient.DownloadFile($seaURL, $seaPath)

# 7z x $seaPath -oGrowlInstaller | out-null

# echo "Done."
# - name: Retrieve Growl Installer (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# uses: actions/cache@v2
# with:
# path: GrowlInstaller
# key: '${{ runner.os }}-growl-installer'
# restore-keys: |
# ${{ runner.os }}-growl-installer
# - name: Add Growl Installer to Path (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# run: 'echo "C:\Program Files (x86)\Growl for Windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8'
# - name: Install Growl
# if: "${{ matrix.os == 'windows-2019' }}"
# run: |
# echo "Installing Growl..."
# cmd /c start /wait msiexec /i GrowlInstaller\Growl_v2.0.msi /quiet
# echo "Done."
# - name: Start Growl Service (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# run: |
# echo "Starting Growl service..."
# Start-Process -NoNewWindow Growl
# ## Growl requires some time before it's ready to handle notifications
# echo "Verifying Growl responding"
# Start-Sleep -s 10
# growlnotify test
- name: Install libnotify-bin (Linux)
if: "${{ matrix.os == 'ubuntu-latest' }}"
run: sudo apt-get install libnotify-bin
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '${{ matrix.node }}'
- uses: actions/checkout@v2
- name: 'Cache node_modules (Linux)'
if: "${{ matrix.os != 'windows-2019' }}"
uses: actions/cache@v2
- uses: actions/checkout@v4
with:
path: '~/.npm'
persist-credentials: false
- name: Get npm cache directory in Windows
id: npm-cache
if: ${{ matrix.os == 'windows-2019' }}
run: |
echo "dir=$(npm config get cache)" >> $env:GITHUB_OUTPUT
- name: 'Cache node_modules'
uses: actions/cache@v3
with:
path: ${{ matrix.os == 'ubuntu-latest' && '~/.npm' || steps.npm-cache.outputs.dir }}
key: "${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Install Annotation Support
Expand All @@ -165,39 +129,77 @@ jobs:
# this is so mocha-github-actions-reporter can find mocha
NODE_PATH: lib
- name: Generate Coverage Report (Linux + Node.js latest)
if: '${{ matrix.env.COVERAGE }}'
if: ${{ matrix.env.COVERAGE }}
run: npm start coverage-report-lcov
- name: Upload Coverage to Coveralls (Linux + Node.js latest)
if: '${{ matrix.env.COVERAGE }}'
if: ${{ matrix.env.COVERAGE }}
uses: coverallsapp/github-action@master
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
test-browser:
# TODO: configure to retain build artifacts in `.karma/` dir
name: 'Browser Tests'

test-browser-local:
name: Browser Test [ChromeHeadless]
needs: smoke
runs-on: ubuntu-latest
timeout-minutes: 20
# Don't run forked 'pull_request' without saucelabs token
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: 'Cache node_modules'
uses: actions/cache@v3
with:
path: '~/.npm'
# this key is different than above, since we are running scripts
# (builds, postinstall lifecycle hooks, etc.)
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
- name: Install Dependencies
run: npm ci
- name: Run Browser Tests
run: npm start test.browser
env:
BROWSER: ChromeHeadless

test-browser-saucelabs:
name: Browser Tests on SauceLabs [${{ matrix.browser }}]
needs:
- smoke
- test-browser-local
runs-on: ubuntu-latest
# Run 'push' event only because of sauce labs token
if: github.event_name == 'push'
timeout-minutes: 20
strategy:
matrix:
browser:
- firefox@latest
- chrome@latest
- MicrosoftEdge@latest
- safari@latest
# Don't run forked 'pull_request' without saucelabs token
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/checkout@v4
with:
node-version: 16
- uses: actions/checkout@v2
persist-credentials: false
- name: 'Cache node_modules'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: '~/.npm'
# this key is different than above, since we are running scripts
# (builds, postinstall lifecycle hooks, etc.)
key: "ubuntu-latest-node-full-v16-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-full-v16-
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
- name: Install Dependencies
run: npm ci
- name: Run Browser Tests
run: npm start test.browser
env:
SAUCE_USERNAME: '${{secrets.SAUCE_USERNAME}}'
SAUCE_ACCESS_KEY: '${{secrets.SAUCE_ACCESS_KEY}}'
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
BROWSER: ${{ matrix.browser }}
2 changes: 1 addition & 1 deletion .github/workflows/nightly-site-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Webhook Action
uses: joelwmale/webhook-action@1.0.0
uses: joelwmale/webhook-action@2.3.2
env:
data: ''
WEBHOOK_URL: ${{ secrets.NETLIFY_NIGHTLY_DEPLOY_URL }}
Loading

0 comments on commit 497aa0c

Please sign in to comment.