From b3cac2c29669626568943b464363c4ef2bfacfb9 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:10:28 +0200 Subject: [PATCH] Enable webstandard job after fixed image This reverts commit 90c3ab89c6d5a94857fe51dbc9cb8b6b0fd32b76. --- .github/jobs/webstandard.sh | 6 +-- .github/workflows/webstandard.yml | 68 +++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/webstandard.yml diff --git a/.github/jobs/webstandard.sh b/.github/jobs/webstandard.sh index 69f2191dd2..4f2f1db026 100755 --- a/.github/jobs/webstandard.sh +++ b/.github/jobs/webstandard.sh @@ -14,7 +14,7 @@ ROLE="$2" cd /opt/domjudge/domserver section_start "Setup pa11y" -pa11y --version +/home/domjudge/node_modules/.bin/pa11y --version section_end section_start "Setup the test user" @@ -143,8 +143,8 @@ else for file in $(find $URL -name "*.html") do section_start "$file" - su domjudge -c "pa11y --config .github/jobs/pa11y_config.json $STAN -r json -T $ACCEPTEDERR $FLTR $file" | python3 -m json.tool - ERR=$(su domjudge -c "pa11y --config .github/jobs/pa11y_config.json $STAN -r csv -T $ACCEPTEDERR $FLTR $file" | wc -l) + su domjudge -c "/home/domjudge/node_modules/.bin/pa11y --config .github/jobs/pa11y_config.json $STAN -r json -T $ACCEPTEDERR $FLTR $file" | python3 -m json.tool + ERR=$(su domjudge -c "/home/domjudge/node_modules/.bin/pa11y --config .github/jobs/pa11y_config.json $STAN -r csv -T $ACCEPTEDERR $FLTR $file" | wc -l) FOUNDERR=$((ERR+FOUNDERR-1)) # Remove header row section_end done diff --git a/.github/workflows/webstandard.yml b/.github/workflows/webstandard.yml new file mode 100644 index 0000000000..ac9bc25756 --- /dev/null +++ b/.github/workflows/webstandard.yml @@ -0,0 +1,68 @@ +name: Webstandard (WCAG, W3C) +on: + push: + branches: + - main + - '[0-9]+.[0-9]+' + pull_request: + branches: + - main + - '[0-9]+.[0-9]+' + +jobs: + standards: + runs-on: ubuntu-latest + container: + image: domjudge/gitlabci:24.04 + services: + sqlserver: + image: mariadb + ports: + - 3306:3306 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_USER: domjudge + MYSQL_PASSWORD: domjudge + options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 + strategy: + matrix: + role: [public, team, balloon, jury, admin] + test: [w3cval, WCAG2A, WCAG2AA] + db: [bare-install, install] + releaseBranch: + - ${{ contains(github.ref, 'main') }} + exclude: + - releaseBranch: false + - role: jury + test: WCAG2AA + - role: jury + test: WCAG2A + - role: admin + test: WCAG2AA + - role: admin + test: WCAG2A + include: + - role: public + test: WCAG2AA + db: install + - role: public + test: w3cval + db: install + - role: admin + test: w3cval + db: install + steps: + - uses: actions/checkout@v4 + - name: Install DOMjudge + run: .github/jobs/baseinstall.sh ${{ matrix.role }} + - name: Run webstandard tests (W3C, WCAG) + run: .github/jobs/webstandard.sh ${{ matrix.test }} ${{ matrix.role }} + - name: Upload all logs/artifacts + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.role }}-${{ matrix.test }}-${{ matrix.db }}-logs + path: | + /tmp/artifacts + /var/log/nginx + /opt/domjudge/domserver/webapp/var/log/*.log