Skip to content

Commit 3d15651

Browse files
committed
Docker PR build
1 parent 781e5bf commit 3d15651

28 files changed

+308
-143
lines changed

.github/workflows/dockers.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/on-push.yml

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ jobs:
354354
inv demo-app
355355
- uses: actions/upload-artifact@v4
356356
with:
357-
name: demoapp--bb-test-${{ matrix.os }}
357+
name: demoapp-bb-test-${{ matrix.os }}
358358
path: zip_results/demoapp
359359
if-no-files-found: error
360360
- name: Create Distributable BrowserBatteries Package
@@ -389,22 +389,22 @@ jobs:
389389
uses: actions/setup-node@v6
390390
with:
391391
node-version: "22.x"
392-
- name: Download rfbrowser-wheel for BrowserBatteries tests
392+
- name: Download browser-wheel
393393
uses: actions/download-artifact@v5
394394
with:
395395
name: rfbrowser-wheel-bb-test
396396
path: rfbrowser-wheel
397-
- name: Download BrowserBatteries wheels
397+
- name: Download BrowserBatteries wheel
398398
uses: actions/download-artifact@v5
399399
with:
400400
name: browser-batteries-wheels-bb-test-${{ matrix.os }}
401401
path: browser-batteries-wheels
402-
- name: Download demoapp wheels
402+
- name: Download demoapp
403403
uses: actions/download-artifact@v5
404404
with:
405-
name: demoapp--bb-test-${{ matrix.os }}
405+
name: demoapp-bb-test-${{ matrix.os }}
406406
path: demoapp
407-
- name: Install Browser and BrowserBatteries on ${{ matrix.os }}
407+
- name: Install Browser and BrowserBatteries
408408
run: |
409409
python -m pip install --upgrade pip
410410
pip install rfbrowser-wheel/robotframework_browser-*-py3-none-any.whl
@@ -422,7 +422,7 @@ jobs:
422422
ls -l demoapp
423423
unzip demoapp/demo-app*.zip -d .
424424
- name: Run tests on Linux with packed demoapp
425-
if : matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
425+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
426426
run: |
427427
xvfb-run --auto-servernum invoke atest-robot --smoke
428428
- name: Run tests on MacOS with packed demoapp
@@ -440,3 +440,64 @@ jobs:
440440
python -m GHAReports --robotlog atest/output/output.xml
441441
python -m GHAReports --robotlog atest/output/output.xml --markdown fail.md --no-totals --no-passes --no-skipped --fails --no-warnings
442442
cat fail.md
443+
444+
docker_image:
445+
runs-on: ubuntu-latest
446+
needs: build_browser_batteries_wheels
447+
permissions: write-all
448+
steps:
449+
- uses: actions/checkout@v5
450+
- uses: actions/setup-python@v6
451+
with:
452+
python-version: "3.14"
453+
cache: 'pip'
454+
- name: Docker meta
455+
id: meta
456+
uses: docker/metadata-action@v5
457+
with:
458+
images: ghcr.io/marketsquare/robotframework-browser/rfbrowser
459+
tags: |
460+
type=raw,value=tidii
461+
- name: Download browser wheel
462+
uses: actions/download-artifact@v5
463+
with:
464+
name: rfbrowser-wheel-bb-test
465+
path: docker/dist
466+
- name: Login to GitHub Container Registry
467+
uses: docker/login-action@v3
468+
with:
469+
registry: ghcr.io
470+
username: ${{ github.actor }}
471+
password: ${{ secrets.GITHUB_TOKEN }}
472+
- name: Build with GitHub Packages
473+
uses: docker/build-push-action@v6
474+
with:
475+
context: .
476+
file: docker/Dockerfile.dev_pr
477+
tags: tidii
478+
labels: ${{ steps.meta.outputs.labels }}
479+
push: false
480+
- name: Download demo app
481+
uses: actions/download-artifact@v5
482+
with:
483+
name: demoapp-bb-test-ubuntu-latest
484+
path: demoapp
485+
- name: unzip demo app
486+
run: |
487+
rm -rf node
488+
ls -l demoapp
489+
unzip demoapp/demo-app*.zip -d .
490+
ls -l node
491+
- name: Start demo app and run tests with docker image
492+
run: |
493+
pip install uv
494+
uv pip install invoke robotframework-ghareports --python 3.14 --system
495+
invoke run-test-app-no-build --asynchronous
496+
docker run -v ./atest/:/home/pwuser/test -t tidii:latest bash -c "robot -v SERVER:172.17.0.1:7272 --exclude no-docker-pr -L debug --outputdir /home/pwuser/output /home/pwuser/test"
497+
inv docker-copy-output
498+
- name: Github Job Summary
499+
if: ${{ always() }}
500+
run: |
501+
python -m GHAReports --robotlog output_docker/output.xml
502+
python -m GHAReports --robotlog output_docker/output.xml --markdown fail.md --no-totals --no-passes --no-skipped --fails --no-warnings
503+
cat fail.md

.github/workflows/on-release.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,102 @@ jobs:
266266
twine check dist/*
267267
- name: Publish BrowserBatteries distribution to PyPI
268268
uses: pypa/gh-action-pypi-publish@release/v1
269+
270+
docker-image:
271+
needs: publish-browser-to-pypi
272+
runs-on: ubuntu-latest
273+
steps:
274+
- uses: actions/checkout@v5
275+
- name: Set up QEMU for cross-platforms builds
276+
uses: docker/setup-qemu-action@v3
277+
- name: Set up Docker Buildx
278+
uses: docker/setup-buildx-action@v3
279+
280+
- name: Login to Docker Hub
281+
uses: docker/login-action@v3
282+
with:
283+
username: ${{ secrets.DOCKER_USERNAME }}
284+
password: ${{ secrets.DOCKER_TOKEN }}
285+
286+
- name: Docker meta
287+
id: meta
288+
uses: docker/metadata-action@v5
289+
with:
290+
images: marketsquare/robotframework-browser
291+
tags: |
292+
type=ref,event=branch
293+
type=semver,pattern={{version}}
294+
type=semver,pattern={{major}}.{{minor}}
295+
type=semver,pattern={{major}}
296+
flavor: |
297+
latest=true
298+
299+
- name: Push tag :version_number to Docker Hub
300+
uses: docker/build-push-action@v6
301+
with:
302+
tags: ${{ steps.meta.outputs.tags }}
303+
file: docker/Dockerfile.latest_release
304+
platforms: linux/arm64/v8,linux/amd64
305+
push: ${{ github.event_name != 'push' }}
306+
307+
- name: Docker meta
308+
id: meta_github
309+
uses: docker/metadata-action@v5
310+
with:
311+
images: ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable
312+
tags: |
313+
type=ref,event=branch
314+
type=semver,pattern={{version}}
315+
type=semver,pattern={{major}}.{{minor}}
316+
type=semver,pattern={{major}}
317+
flavor: |
318+
latest=true
319+
320+
- name: Login to GitHub Container Registry
321+
uses: docker/login-action@v3
322+
with:
323+
registry: ghcr.io
324+
username: ${{ github.actor }}
325+
password: ${{ secrets.GITHUB_TOKEN }}
326+
327+
- name: Push to GitHub Packages
328+
uses: docker/build-push-action@v6
329+
with:
330+
platforms: linux/arm64/v8,linux/amd64
331+
file: docker/Dockerfile.latest_release
332+
tags: ${{ steps.meta_github.outputs.tags }}
333+
push: ${{ github.event_name != 'push' }}
334+
335+
test-docker-image:
336+
needs: docker-image
337+
runs-on: ubuntu-latest
338+
steps:
339+
- uses: actions/checkout@v5
340+
- name: Set up Python 3.11
341+
uses: actions/setup-python@v6
342+
with:
343+
python-version: 3.11
344+
cache: 'pip'
345+
- name: Install python dependencies
346+
run: |
347+
python -m pip install --upgrade pip
348+
pip install uv
349+
uv pip install wheel --python 3.11 --system
350+
uv pip install -r Browser/dev-requirements.txt --python 3.11 --system
351+
- name: Install invoke deps
352+
run: |
353+
invoke deps
354+
- name: build testing docker image
355+
run: |
356+
invoke docker-tester
357+
- name: set permissions
358+
run: chmod -R 777 atest/
359+
- name: Run tests with latest stable docker image
360+
# continue on error until all docker tests pass
361+
run: |
362+
invoke docker-test
363+
- uses: actions/upload-artifact@v4
364+
if: ${{ always() }}
365+
with:
366+
name: Docker test results
367+
path: atest/output

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ __pycache__
2222
robotframework_browser.egg-info/
2323
.venv
2424
zip_results
25+
mypy_stub
2526

2627
# utest
2728
utest/output

atest/test/01_Browser_Management/chromiun_channel.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Resource imports.resource
33

44
Suite Teardown Close Browser ALL
55

6+
Test Tags no-docker-pr
7+
68
*** Test Cases ***
79
Wrong Browser With Channel
810
Run Keyword And Expect Error

atest/test/01_Browser_Management/client_certificates.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Suite Setup Setup
66
Suite Teardown Suite Teardown
77
Test Teardown Close Browser ALL
88

9+
Test Tags no-docker-pr
10+
911
*** Test Cases ***
1012
Open Browser With Client Certificate
1113
New Browser browser=${BROWSER} headless=${HEADLESS}

atest/test/01_Browser_Management/geolocation.robot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ Force Tags no-iframe
2121

2222
*** Test Cases ***
2323
Set Geolocation On Browser Startup
24+
[Tags] no-docker-pr
2425
Start Context With Geolocation
2526
Check Geolocation 42 -42.42
2627

2728
Set Geolocation
29+
[Tags] no-docker-pr
2830
[Setup] Start Context With Geolocation
2931
Set Geolocation 72.56 145.89 0.23
3032
Check Geolocation 72.56 145.89
3133

3234
Enable Geolocation
35+
[Tags] no-docker-pr
3336
[Setup] Start Context Without Geolocation
3437
Set Browser Timeout timeout=500ms scope=Test
3538
Set Geolocation 11.11 22.22 33.33

atest/test/01_Browser_Management/playwright_state.robot

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ New Context Does Not Open A Page
2828
Should Be Equal ${no_page_id} NO PAGE OPEN
2929

3030
Open Browser Opens Everything
31-
[Tags] slow
31+
[Tags] slow no-docker-pr
3232
${old_timeout} = Set Browser Timeout 30 seconds
3333
Open Browser url=${FORM_URL}
3434
Get Title == prefilled_email_form.html
@@ -262,6 +262,7 @@ New Context With DefaultBrowserType Ff
262262
Set Browser Timeout ${old_timeout}
263263

264264
New Context With baseURL
265+
[Tags] no-docker-pr
265266
New Context baseURL=${ROOT_URL}
266267
New Page dist/#/
267268
Get Url == ${LOGIN_URL}
@@ -440,6 +441,7 @@ Launch Browser Server Generated wsEndpoint
440441
[Teardown] Close Browser Server ${wsEndpoint}
441442

442443
Launch Browser Server Via CLI
444+
[Tags] no-docker-pr
443445
${python} = Get Python Binary Path
444446
${process1} = Start Process
445447
... ${python}

0 commit comments

Comments
 (0)