Track immutable production revision and record browser acceptance
Build and deploy / deploy (push) Successful in 9s

This commit is contained in:
huncode committed 2026-10-26 14:26:17 +03:00
1 parent a2829a6528
commit 4ee9c0ef81
5 files changed
+42 -8

No files matched your search

+6 -8
View File
@@ -6,6 +6,10 @@ on:
- master
workflow_dispatch:
concurrency:
group: production-progcode
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
@@ -37,14 +41,8 @@ jobs:
short_sha="${GITHUB_SHA:-${GITEA_SHA:-manual}}"
short_sha="${short_sha:0:12}"
if [ -z "${IMAGE}" ]; then
: "${IMAGE_REPO:?Set IMAGE or IMAGE_REPO in Gitea variables}"
IMAGE_REPO="git.pryanik.synology.me/huncode/progcode"
IMAGE="${IMAGE_REPO}:${short_sha}"
fi
if [ -z "${IMAGE_REPO}" ]; then
IMAGE_REPO="${IMAGE%:*}"
fi
{
echo "IMAGE=${IMAGE}"
@@ -74,7 +72,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
docker build --pull -t "${IMAGE}" .
docker build --pull --build-arg SOURCE_COMMIT="${GITHUB_SHA:-${GITEA_SHA:-unknown}}" -t "${IMAGE}" .
- name: Push image
shell: bash
+2
View File
@@ -11,6 +11,8 @@ COPY web/ ./
RUN npm run build
FROM joseluisq/static-web-server:2-alpine
ARG SOURCE_COMMIT=unknown
LABEL org.opencontainers.image.revision=$SOURCE_COMMIT
ENV SERVER_ROOT=/public \
SERVER_PORT=8080 \
+34
View File
@@ -0,0 +1,34 @@
### Result
{"focus":[{"tag":"A","text":"</> ProgCode.Ru","id":"","outline":"solid"},{"tag":"A","text":"Архив","id":"","outline":"solid"},{"tag":"A","text":"JSON-инструмент","id":"","outline":"solid"},{"tag":"A","text":"Об источниках","id":"","outline":"solid"},{"tag":"A","text":"Читать архив ↓","id":"","outline":"solid"},{"tag":"INPUT","text":"","id":"search","outline":"solid"}],"searchResults":3,"topicPressed":"true","valid":"{\n \"ok\": true\n}","invalid":"Ошибка JSON: Expected property name or '}' in JSON at position 1 (line 1 column 2)"}
### Ran Playwright code
```js
await (async page => {
await page.setViewportSize({width:390,height:844});
await page.goto('http://127.0.0.1:52964/');
const focus=[];
for(let i=0;i<12;i++){if(await page.locator('#search').evaluate(e=>e===document.activeElement))break;await page.keyboard.press('Tab');focus.push(await page.evaluate(()=>({tag:document.activeElement.tagName,text:document.activeElement.textContent, id:document.activeElement.id,outline:getComputedStyle(document.activeElement).outlineStyle})));}
if(await page.locator('#search').evaluate(e=>e!==document.activeElement)) throw Error('Search is not keyboard reachable');
await page.keyboard.type('Bitrix');
const found=await page.locator('.article-card').count();if(found!==3)throw Error('Search expected 3');
await page.keyboard.press('ControlOrMeta+A');await page.keyboard.press('Backspace');
for(let i=0;i<3;i++)await page.keyboard.press('Tab');
await page.keyboard.press('Enter');
const topic=await page.getByRole('button',{name:'Bitrix',exact:true}).getAttribute('aria-pressed');if(topic!=='true')throw Error('Topic keyboard failed');
await page.goto('http://127.0.0.1:52964/tools/');
for(let i=0;i<12;i++){if(await page.locator('#json').evaluate(e=>e===document.activeElement))break;await page.keyboard.press('Tab');}
if(await page.locator('#json').evaluate(e=>e!==document.activeElement))throw Error('Textarea keyboard focus failed');
await page.keyboard.press('ControlOrMeta+A');await page.keyboard.type('{"ok":true}');
await page.keyboard.press('Tab');await page.keyboard.press('Enter');
const valid=await page.getByRole('status').innerText();if(!valid.includes('"ok": true'))throw Error('Valid JSON failed');
await page.keyboard.press('Shift+Tab');await page.keyboard.press('ControlOrMeta+A');await page.keyboard.type('{broken');
await page.keyboard.press('Tab');await page.keyboard.press('Enter');
const invalid=await page.getByRole('status').innerText();if(!invalid.includes('Ошибка JSON'))throw Error('Error JSON failed');
await page.screenshot({path:'/tmp/progcode-keyboard-focus.png'});
await page.screenshot({path:'/tmp/progcode-mobile-tools-full.png',fullPage:true});
return {focus,searchResults:found,topicPressed:topic,valid,invalid};
}
)(page);
```
### Page
- Page URL: http://127.0.0.1:52964/tools/
- Page Title: ProgCode.Ru — архив программиста
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB