Karim shoair commited on
Commit ·
24e9e28
1
Parent(s): f88c43a
test: fixes for Github CI issues
Browse files- .github/workflows/tests.yml +20 -4
- pytest.ini +1 -1
.github/workflows/tests.yml
CHANGED
|
@@ -60,6 +60,13 @@ jobs:
|
|
| 60 |
python3 -m pip install --upgrade pip
|
| 61 |
python3 -m pip install playwright>=1.55.0 patchright>=1.55.0 camoufox
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
- name: Retrieve Playwright browsers from cache if any
|
| 64 |
id: playwright-cache
|
| 65 |
uses: actions/cache@v4
|
|
@@ -68,16 +75,24 @@ jobs:
|
|
| 68 |
~/.cache/ms-playwright
|
| 69 |
~/Library/Caches/ms-playwright
|
| 70 |
~/.ms-playwright
|
| 71 |
-
key: ${{ runner.os }}-playwright-${{
|
| 72 |
restore-keys: |
|
|
|
|
| 73 |
${{ runner.os }}-playwright-
|
| 74 |
|
| 75 |
- name: Install Playwright browsers
|
| 76 |
-
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
| 77 |
run: |
|
|
|
|
| 78 |
python3 -m playwright install chromium
|
| 79 |
python3 -m playwright install-deps chromium firefox
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
- name: Retrieve Camoufox browser from cache if any
|
| 82 |
id: camoufox-cache
|
| 83 |
uses: actions/cache@v4
|
|
@@ -85,13 +100,14 @@ jobs:
|
|
| 85 |
path: |
|
| 86 |
~/.cache/camoufox
|
| 87 |
~/Library/Caches/camoufox
|
| 88 |
-
key: ${{ runner.os }}-camoufox-${{
|
| 89 |
restore-keys: |
|
|
|
|
| 90 |
${{ runner.os }}-camoufox-
|
| 91 |
|
| 92 |
- name: Install Camoufox browser
|
| 93 |
-
if: steps.camoufox-cache.outputs.cache-hit != 'true'
|
| 94 |
run: |
|
|
|
|
| 95 |
python3 -m camoufox fetch --browserforge
|
| 96 |
|
| 97 |
# Cache tox environments
|
|
|
|
| 60 |
python3 -m pip install --upgrade pip
|
| 61 |
python3 -m pip install playwright>=1.55.0 patchright>=1.55.0 camoufox
|
| 62 |
|
| 63 |
+
- name: Get Playwright version
|
| 64 |
+
id: playwright-version
|
| 65 |
+
run: |
|
| 66 |
+
PLAYWRIGHT_VERSION=$(python3 -c "import playwright; print(playwright.__version__)")
|
| 67 |
+
echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
| 68 |
+
echo "Playwright version: $PLAYWRIGHT_VERSION"
|
| 69 |
+
|
| 70 |
- name: Retrieve Playwright browsers from cache if any
|
| 71 |
id: playwright-cache
|
| 72 |
uses: actions/cache@v4
|
|
|
|
| 75 |
~/.cache/ms-playwright
|
| 76 |
~/Library/Caches/ms-playwright
|
| 77 |
~/.ms-playwright
|
| 78 |
+
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}-v1
|
| 79 |
restore-keys: |
|
| 80 |
+
${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}-
|
| 81 |
${{ runner.os }}-playwright-
|
| 82 |
|
| 83 |
- name: Install Playwright browsers
|
|
|
|
| 84 |
run: |
|
| 85 |
+
echo "Cache hit: ${{ steps.playwright-cache.outputs.cache-hit }}"
|
| 86 |
python3 -m playwright install chromium
|
| 87 |
python3 -m playwright install-deps chromium firefox
|
| 88 |
|
| 89 |
+
- name: Get Camoufox version
|
| 90 |
+
id: camoufox-version
|
| 91 |
+
run: |
|
| 92 |
+
CAMOUFOX_VERSION=$(python3 -c "import camoufox; print(camoufox.__version__)")
|
| 93 |
+
echo "version=$CAMOUFOX_VERSION" >> $GITHUB_OUTPUT
|
| 94 |
+
echo "Camoufox version: $CAMOUFOX_VERSION"
|
| 95 |
+
|
| 96 |
- name: Retrieve Camoufox browser from cache if any
|
| 97 |
id: camoufox-cache
|
| 98 |
uses: actions/cache@v4
|
|
|
|
| 100 |
path: |
|
| 101 |
~/.cache/camoufox
|
| 102 |
~/Library/Caches/camoufox
|
| 103 |
+
key: ${{ runner.os }}-camoufox-${{ steps.camoufox-version.outputs.version }}-v1
|
| 104 |
restore-keys: |
|
| 105 |
+
${{ runner.os }}-camoufox-${{ steps.camoufox-version.outputs.version }}-
|
| 106 |
${{ runner.os }}-camoufox-
|
| 107 |
|
| 108 |
- name: Install Camoufox browser
|
|
|
|
| 109 |
run: |
|
| 110 |
+
echo "Cache hit: ${{ steps.camoufox-cache.outputs.cache-hit }}"
|
| 111 |
python3 -m camoufox fetch --browserforge
|
| 112 |
|
| 113 |
# Cache tox environments
|
pytest.ini
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
[pytest]
|
| 2 |
-
asyncio_mode =
|
| 3 |
asyncio_default_fixture_loop_scope = function
|
| 4 |
addopts = -p no:warnings --doctest-modules --ignore=setup.py --verbose
|
| 5 |
markers =
|
|
|
|
| 1 |
[pytest]
|
| 2 |
+
asyncio_mode = strict
|
| 3 |
asyncio_default_fixture_loop_scope = function
|
| 4 |
addopts = -p no:warnings --doctest-modules --ignore=setup.py --verbose
|
| 5 |
markers =
|