-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prettier provides the same experience as Python's Black, when working on web-related stuff.
- Loading branch information
1 parent
1e3a8fa
commit 2372189
Showing
15 changed files
with
322 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,59 +6,56 @@ env: | |
COVERAGE_THRESHOLD: 60 | ||
|
||
jobs: | ||
|
||
lint: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Node/yarn | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Cache python wheels | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: 'node_modules' | ||
key: | | ||
${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade pre-commit | ||
python -m pip install -e . | ||
yarn --frozen-lockfile | ||
- name: Lint | ||
run: | | ||
pre-commit run --all-files | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Node/yarn | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "16.x" | ||
|
||
- name: Cache python wheels | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: "node_modules" | ||
key: | | ||
${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade pre-commit | ||
python -m pip install -e . | ||
yarn --frozen-lockfile | ||
- name: Lint | ||
run: | | ||
pre-commit run --all-files | ||
# Build docs on a number of Python versions. In the future this can be | ||
# where tests go. | ||
tests: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -68,49 +65,48 @@ jobs: | |
dev: true | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache python wheels | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install -e .[coverage] | ||
- name: Install pre-release dependencies | ||
if: ${{ matrix.dev }} | ||
run: pip install --upgrade --pre sphinx jinja2 | ||
|
||
# Build the docs | ||
- name: Build docs to store | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
sphinx-build -b html docs/ docs/_build/html -W --keep-going | ||
# Run tests under coverage | ||
- name: Run the tests | ||
run: pytest --cov pydata_sphinx_theme --cov-branch --cov-report term-missing:skip-covered --cov-fail-under ${{ env.COVERAGE_THRESHOLD }} | ||
|
||
- name: Upload coverage | ||
if: ${{ always() }} | ||
run: codecov | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache python wheels | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install -e .[coverage] | ||
- name: Install pre-release dependencies | ||
if: ${{ matrix.dev }} | ||
run: pip install --upgrade --pre sphinx jinja2 | ||
|
||
# Build the docs | ||
- name: Build docs to store | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
sphinx-build -b html docs/ docs/_build/html -W --keep-going | ||
# Run tests under coverage | ||
- name: Run the tests | ||
run: pytest --cov pydata_sphinx_theme --cov-branch --cov-report term-missing:skip-covered --cov-fail-under ${{ env.COVERAGE_THRESHOLD }} | ||
|
||
- name: Upload coverage | ||
if: ${{ always() }} | ||
run: codecov | ||
|
||
# Run local Lighthouse audit against built site | ||
audit: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -124,98 +120,97 @@ jobs: | |
PA11Y_BUILD: /tmp/pa11y/pa11y-${{ github.run_number }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Node/yarn | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Cache python wheels | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: 'node_modules' | ||
key: | | ||
${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip wheel setuptools | ||
python -m pip install -e .[coverage] | ||
yarn --frozen-lockfile | ||
# Build the docs | ||
- name: Build docs to store | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
sphinx-build -b html docs/ docs/_build/html -W --keep-going | ||
# Serve the docs and wait to be ready | ||
- name: Serve the built site | ||
run: | | ||
nohup python docs/serve.py --port=${PORT} --host=${HOST} & | ||
curl --retry 10 --retry-connrefused --retry-max-time 60 ${URL}/index.html | ||
# Run the audit | ||
# TODO: use the hosted API with a secret? would allow for comparison over time... | ||
- name: Make folder for Lighthouse reports | ||
run: mkdir -p /tmp/lighthouse/lighthouse-${{ github.run_number }} | ||
|
||
- name: Run Lighthouse on Site | ||
id: lighthouse | ||
uses: foo-software/[email protected] | ||
with: | ||
# TODO: generate this list to audit all html pages | ||
urls: >- | ||
${{ env.URL }}/index.html, | ||
${{ env.URL }}/demo/api.html, | ||
${{ env.URL }}/demo/demo.html, | ||
${{ env.URL }}/demo/example_pandas.html, | ||
${{ env.URL }}/user_guide/accessibility.html | ||
outputDirectory: /tmp/lighthouse/lighthouse-${{ github.run_number }} | ||
verbose: true | ||
|
||
- name: Run the accessibility audit | ||
run: python docs/a11y.py --no-serve | ||
|
||
# Check the audit for threshold values | ||
# TODO: write this someplace after a PR is merged, and load? | ||
- name: Assess Lighthouse Check results | ||
uses: foo-software/[email protected] | ||
with: | ||
lighthouseCheckResults: ${{ steps.lighthouse.outputs.lighthouseCheckResults }} | ||
minAccessibilityScore: "96" | ||
minBestPracticesScore: "85" | ||
minPerformanceScore: "10" | ||
minSeoScore: "80" | ||
if: always() | ||
|
||
- name: Publish Audit reports | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Pa11y and Lighthouse ${{ github.run_number }} | ||
path: | | ||
/tmp/pa11y | ||
/tmp/lighthouse | ||
if: always() | ||
- uses: actions/checkout@v2 | ||
|
||
publish: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Node/yarn | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "16.x" | ||
|
||
- name: Cache python wheels | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: "node_modules" | ||
key: | | ||
${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip wheel setuptools | ||
python -m pip install -e .[coverage] | ||
yarn --frozen-lockfile | ||
# Build the docs | ||
- name: Build docs to store | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
sphinx-build -b html docs/ docs/_build/html -W --keep-going | ||
# Serve the docs and wait to be ready | ||
- name: Serve the built site | ||
run: | | ||
nohup python docs/serve.py --port=${PORT} --host=${HOST} & | ||
curl --retry 10 --retry-connrefused --retry-max-time 60 ${URL}/index.html | ||
# Run the audit | ||
# TODO: use the hosted API with a secret? would allow for comparison over time... | ||
- name: Make folder for Lighthouse reports | ||
run: mkdir -p /tmp/lighthouse/lighthouse-${{ github.run_number }} | ||
|
||
- name: Run Lighthouse on Site | ||
id: lighthouse | ||
uses: foo-software/[email protected] | ||
with: | ||
# TODO: generate this list to audit all html pages | ||
urls: >- | ||
${{ env.URL }}/index.html, | ||
${{ env.URL }}/demo/api.html, | ||
${{ env.URL }}/demo/demo.html, | ||
${{ env.URL }}/demo/example_pandas.html, | ||
${{ env.URL }}/user_guide/accessibility.html | ||
outputDirectory: /tmp/lighthouse/lighthouse-${{ github.run_number }} | ||
verbose: true | ||
|
||
- name: Run the accessibility audit | ||
run: python docs/a11y.py --no-serve | ||
|
||
# Check the audit for threshold values | ||
# TODO: write this someplace after a PR is merged, and load? | ||
- name: Assess Lighthouse Check results | ||
uses: foo-software/[email protected] | ||
with: | ||
lighthouseCheckResults: ${{ steps.lighthouse.outputs.lighthouseCheckResults }} | ||
minAccessibilityScore: "96" | ||
minBestPracticesScore: "85" | ||
minPerformanceScore: "10" | ||
minSeoScore: "80" | ||
if: always() | ||
|
||
- name: Publish Audit reports | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Pa11y and Lighthouse ${{ github.run_number }} | ||
path: | | ||
/tmp/pa11y | ||
/tmp/lighthouse | ||
if: always() | ||
|
||
publish: | ||
name: Publish to PyPi | ||
needs: [lint, tests] | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.