Skip to content

Commit

Permalink
Move Playwright-Axe testing code from jupyter/accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Jul 21, 2022
1 parent a610cd1 commit bc2e765
Show file tree
Hide file tree
Showing 35 changed files with 10,760 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/gitpod-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Gitpod Docker image

on:
push:
branches:
- master

jobs:
build:
name: Build Gitpod Docker image
runs-on: ubuntu-latest
environment: a11y-dev
if: "github.repository_owner == 'jupyter' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')"
steps:
- name: Clone repository ⚡
uses: actions/checkout@v3

- name: Lint Docker 🔍
uses: brpaz/hadolint-action@v1.2.1
with:
dockerfile: ./testing/tools/Dockerfile

- name: Get refs
shell: bash
run: |
export raw_branch=${GITHUB_REF#refs/heads/}
echo "::set-output name=branch::${raw_branch//\//-}"
echo "::set-output name=date::$(date +'%Y%m%d')"
echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
id: getrefs

- name: Set up Docker Buildx 🐳
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub 🔑
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push 🛠️
id: docker_build
uses: docker/build-push-action@v3
with:
context: "."
file: "./testing/tools/Dockerfile"
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
quansight/jupyter-a11y:${{ steps.getrefs.outputs.date }}-${{ steps.getrefs.outputs.branch}}-${{ steps.getrefs.outputs.sha8 }}
quansight/jupyter-a11y:latest
- name: Image digest 📖
# Return details of the image build: sha and shell
run: echo ${{ steps.docker_build.outputs.digest }}
43 changes: 43 additions & 0 deletions .github/workflows/test-a11y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: a11y tests

on: [workflow_dispatch, push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Fetch all history for all tags and branches
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""
- name: install development dependencies
run: python -m pip install -e .
- name: list jupyter build tasks
run: python -m jupyter_accessibility -i jupyterlab -- list

- name: establish the runtime systems for the builds
run: python -m jupyter_accessibility -i jupyterlab -- env
- name: setup the development content for building
run: python -m jupyter_accessibility -i jupyterlab -- setup
- name: setup the testing environments
run: python -m jupyter_accessibility -i jupyterlab -- test_setup
- name: run tests against the build
run: python -m jupyter_accessibility -i jupyterlab -- test
- name: upload testing results
uses: actions/upload-artifact@v3
with:
name: a11y-test-results
path: |
jupyter-ally-build/jupyter-axe/test-results/*.html
jupyter-ally-build/jupyter-axe/test-results/**/*.html
jupyter-ally-build/jupyter-axe/test-results/*.json
jupyter-ally-build/jupyter-axe/test-results/**/*.json
136 changes: 136 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Jupyter Book
_build

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# doit
.doit*

# yarn
.yarn-links/
node_modules/

# repos
repos/

# logs
logs/

# reports
reports/

# nox
**.nox/

# playwright stuff
**/playwright-*/
**/test-results/

# mac
.DS_Store

# editor
.vscode
52 changes: 52 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

image: quansight/jupyter-a11y:latest

tasks:
- name: Install JupyterLab Node.js testing dependencies
init: |
cd testing/jupyterlab
echo " 📦 Installing node dependencies "
yarn install
npx playwright install
echo "🚀 Dependencies installed "
cd /workspace/accessibility/
# --------------------------------------------------------
# exposing ports
ports:
- port: 9323
- port: 8888

# some useful extensions to have
vscode:
extensions:
- eamodio.gitlens
- ms-python.python
- yzhang.markdown-all-in-one
- bungcip.better-toml

# --------------------------------------------------------
# using prebuilds for the container
# With this configuration the prebuild will happen on push to master
github:
prebuilds:
# enable for main/default branch
master: true
# enable for other branches (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
# need to change
pullRequests: false
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: false
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
# need to change
addComment: false
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true
# add a label once the prebuild is ready to pull requests (defaults to false)
addLabel: false
7 changes: 7 additions & 0 deletions .hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
ignored:
- DL3006
- DL3008
- SC2016
- DL3004
- DL3007
Loading

0 comments on commit bc2e765

Please sign in to comment.