Build: Really test on Firefox ESR, new & old; simplify cache #166
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Browser Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
NODE_VERSION: 22.x | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: ${{ matrix.NAME || matrix.BROWSER }} (${{ matrix.MIGRATE_VERSION }} Migrate) | |
strategy: | |
fail-fast: false | |
matrix: | |
BROWSER: ["chrome", "firefox"] | |
MIGRATE_VERSION: ["min"] | |
include: | |
- BROWSER: "chrome" | |
MIGRATE_VERSION: "esmodules" | |
- NAME: "Firefox ESR (new)" | |
BROWSER: "firefox" | |
MIGRATE_VERSION: "min" | |
- NAME: "Firefox ESR (old)" | |
BROWSER: "firefox" | |
MIGRATE_VERSION: "min" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock- | |
- name: Set download URL for Firefox ESR (old) | |
run: | | |
echo "FIREFOX_SOURCE_URL=https://download.mozilla.org/?product=firefox-esr-latest-ssl&lang=en-US&os=linux64" >> "$GITHUB_ENV" | |
if: contains(matrix.NAME, 'Firefox ESR (old)') | |
- name: Set download URL for Firefox ESR (new) | |
run: | | |
echo "FIREFOX_SOURCE_URL=https://download.mozilla.org/?product=firefox-esr-next-latest-ssl&lang=en-US&os=linux64" >> "$GITHUB_ENV" | |
if: contains(matrix.NAME, 'Firefox ESR (new)') | |
- name: Install Firefox ESR | |
run: | | |
# Support: Firefox <135 only | |
# Older Firefox used to be compressed using bzip2, newer using xz. Try | |
# to uncompress using xz, fall back to bzip2 if that fails. | |
# Note: this will download the old Firefox ESR twice, but it will still work | |
# when the current ESR version starts to use xz with no changes to the code. | |
wget --no-verbose "$FIREFOX_SOURCE_URL" -O - | tar -Jx -C "$HOME" || \ | |
wget --no-verbose "$FIREFOX_SOURCE_URL" -O - | tar -jx -C "$HOME" | |
echo "PATH=${HOME}/firefox:$PATH" >> "$GITHUB_ENV" | |
echo "FIREFOX_BIN=${HOME}/firefox/firefox" >> "$GITHUB_ENV" | |
if: contains(matrix.NAME, 'Firefox ESR') | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: | | |
npm run pretest | |
npm run build:all | |
npm run test:unit -- -c jtr-local.yml \ | |
--headless -b ${{ matrix.BROWSER }} -f plugin=${{ matrix.MIGRATE_VERSION }} | |
ie: | |
runs-on: windows-latest | |
name: Edge in IE mode (min Migrate) | |
env: | |
MIGRATE_VERSION: "min" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock- | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
shell: cmd | |
run: npm run test:ie -- -c jtr-local.yml -f plugin=${{ env.MIGRATE_VERSION }} | |
safari: | |
runs-on: macos-latest | |
name: Safari (min Migrate) | |
env: | |
MIGRATE_VERSION: "min" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock- | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: npm run test:safari -- -c jtr-local.yml -f plugin=${{ env.MIGRATE_VERSION }} |