-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tox config and docs publishing CI workflow
This commit adds a new CI workflow for publishing documentation to: https://qiskit.org/documentation/partners/mthree/. This workflow is tag triggered, meaning it will run on new releases. This job will run sphinx-build at release time and upload the output to the IBM Cloud Object Storage instance used for qiskit.org. To simplify the job setup and unify the CI config with something local developers can run, a tox.ini is added, Tox enables a single entrypoint that combines venv management with running test commands. The new CI workflow uses it to build a virtual environment to run sphinx from. Local users can leverage the same tox command as CI to run docs builds in the same way as CI.
- Loading branch information
Showing
5 changed files
with
88 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Docs Publish | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7.8' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U virtualenv setuptools wheel tox | ||
sudo apt-get install -y graphviz pandoc | ||
- name: Build and publish | ||
env: | ||
encrypted_rclone_key: ${{ secrets.encrypted_rclone_key }} | ||
encrypted_rclone_iv: ${{ secrets.encrypted_rclone_iv }} | ||
run: | | ||
tools/deploy_documentation.sh |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
#!/bin/bash | ||
|
||
# This code is part of Qiskit. | ||
# | ||
# (C) Copyright IBM 2017, 2021. | ||
# | ||
# This code is licensed under the Apache License, Version 2.0. You may | ||
# obtain a copy of this license in the LICENSE.txt file in the root directory | ||
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Any modifications or derivative works of this code must retain this | ||
# copyright notice, and modified files need to carry a notice indicating | ||
# that they have been altered from the originals. | ||
|
||
# Script for pushing the documentation to the qiskit.org repository. | ||
set -e | ||
|
||
curl https://downloads.rclone.org/rclone-current-linux-amd64.deb -o rclone.deb | ||
sudo apt-get install -y ./rclone.deb | ||
|
||
RCLONE_CONFIG_PATH=$(rclone config file | tail -1) | ||
|
||
# Build the documentation. | ||
tox -edocs | ||
|
||
echo "show current dir: " | ||
pwd | ||
|
||
# Push to qiskit.org website | ||
openssl aes-256-cbc -K $encrypted_rclone_key -iv $encrypted_rclone_iv -in tools/rclone.conf.enc -out $RCLONE_CONFIG_PATH -d | ||
echo "Pushing built docs to website" | ||
rclone sync --progress ./docs/_build/html IBMCOS:qiskit-org-web-resources/documentation/partners/mthree |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[tox] | ||
minversion = 2.1 | ||
envlist = py36, py37, py38, py39, lint, docs | ||
|
||
[testenv] | ||
usedevelop = true | ||
install_command = pip install -c{toxinidir}/constraints.txt -U {opts} {packages} | ||
setenv = | ||
VIRTUAL_ENV={envdir} | ||
LANGUAGE=en_US | ||
LC_ALL=en_US.utf-8 | ||
deps = -r{toxinidir}/requirements.txt | ||
-r{toxinidir}/requirements-dev.txt | ||
commands = | ||
pytest -p no:warnings --pyargs mthree/test | ||
|
||
[testenv:lint] | ||
commands = | ||
pycodestyle --max-line-length=100 mthree | ||
pylint -rn mthree | ||
|
||
[testenv:docs] | ||
changedir = {toxinidir}/docs | ||
allowlist_externals = make | ||
envdir = .tox/docs | ||
commands = make html |