[WIP] tests: Attempt integration tests on more browsers and OSes #3563
This file contains 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: RxPlayer Tests | |
on: | |
push: | |
branches: [stable, dev, legacy-v3] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
format_check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: npm ci | |
- run: rustup target add wasm32-unknown-unknown | |
- run: npm run fmt:prettier:check | |
- run: npm run fmt:rust:check | |
typechecking_and_linting: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- run: npm ci | |
- run: npm run check | |
unit_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- run: npm ci | |
- run: npm run test:unit | |
integration_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
# needed for integration & memory tests codecs support | |
- run: | |
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y | |
ubuntu-restricted-extras | |
- run: | | |
npm ci | |
npm run build | |
npm run test:integration:chrome && npm run test:integration:firefox && npm run test:integration:edge | |
# retry on failure | |
if [ $? -ne 0 ]; then | |
echo "First tests attempt failed. Retrying after 20 seconds..." | |
sleep 20 | |
npm run test:integration:chrome && npm run test:integration:firefox && npm run test:integration:edge | |
fi | |
integration_windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/checkout@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- shell: bash | |
run: | | |
npm ci | |
npm run build | |
npm run test:integration:chrome && npm run test:integration:firefox && npm run test:integration:edge | |
# retry on failure | |
if [ $? -ne 0 ]; then | |
echo "First tests attempt failed. Retrying after 20 seconds..." | |
sleep 20 | |
npm run test:integration:chrome && npm run test:integration:firefox && npm run test:integration:edge | |
fi | |
# Other OSes than linux are particularly bad on github actions, run it three times | |
if [ $? -ne 0 ]; then | |
echo "Second tests attempt failed. Retrying after 60 seconds..." | |
sleep 60 | |
npm run test:integration:chrome && npm run test:integration:firefox && npm run test:integration:edge | |
fi | |
integration_mac: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/checkout@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- run: | | |
npm ci | |
npm run build | |
for browser in "chrome" "firefox" "edge"; do | |
npm run "test:integration:$browser" | |
# retry on failure | |
if [ $? -ne 0 ]; then: | |
echo "First tests attempt failed. Retrying after 20 seconds..." | |
sleep 20 | |
npm run "test:integration:$browser" | |
fi | |
# Other OSes than linux are particularly bad on github actions, run it three times | |
if [ $? -ne 0 ]; then | |
echo "Second tests attempt failed. Retrying after 60 seconds..." | |
sleep 60 | |
npm run "test:integration:$browser" | |
fi | |
done | |
memory_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
# needed for integration & memory tests codecs support | |
- run: | |
sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y | |
ubuntu-restricted-extras | |
- run: npm ci | |
- run: npm run test:memory |