Test 🧪 #3
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: Test 🧪 | |
# yamllint disable rule:truthy | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v2 | |
- name: patch package.json | |
run: | | |
bun install | |
bun run ci:patch | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install corepack and yarn | |
run: | | |
corepack enable | |
yarn set version stable | |
- name: Rollback package.json | |
run: | | |
bun run ci:rollback | |
- name: Prepare Playwright | |
run: npx playwright install --with-deps chromium | |
- name: Run tests in python_only package | |
run: | | |
cd python_only | |
pip install --upgrade pip | |
pip install -r requirements/main.txt -r requirements/dev.txt -r requirements/test.txt | |
python scripts/test.py | |
- name: Run tests in ts_olny package | |
run: | | |
cd ts_only | |
bun install | |
bun run test | |
- name: Run tests in python_and_ts package on ubuntu-latest | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd both | |
bun install | |
sudo apt update && sudo apt install -y xvfb libasound2t64 libgbm1 libgtk-3-0t64 libnss3 lcov > /dev/null 2>&1 || true | |
pip install --upgrade pip | |
pip install -r requirements/main.txt -r requirements/dev.txt -r requirements/test.txt | |
xvfb-run -a bun run test | |
- name: Run tests in python_and_ts on windows-latest | |
if: matrix.os == 'windows-latest' | |
run: | | |
cd both | |
bun install | |
pip install --upgrade pip | |
pip install -r requirements/main.txt -r requirements/dev.txt -r requirements/test.txt | |
bun run test | |
- name: Run tests in python_and_ts on macos-latest | |
if: matrix.os == 'macos-latest' | |
run: | | |
cd both | |
bun install | |
pip install --upgrade pip | |
pip install -r requirements/main.txt -r requirements/dev.txt -r requirements/test.txt | |
bun run test |