-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
3,542 additions
and
617 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,17 @@ | ||
name: "prepare-cache-pip" | ||
description: "Prepare setup cache of pip wheels" | ||
outputs: | ||
cache-dir: | ||
description: "Pip cache dir" | ||
value: ${{ steps.get-pip-cache-dir.outputs.dir }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: upgrade pip setuptools wheel | ||
run: python -m pip install --upgrade pip setuptools wheel | ||
shell: bash | ||
- name: Get pip cache dir | ||
id: get-pip-cache-dir | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
shell: bash |
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,10 @@ | ||
name: "setup-ubuntu-latest-xvfb" | ||
description: "Setup xvfb on ubuntu" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup xvfb on ubuntu | ||
run: | | ||
sudo apt install xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 | ||
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX | ||
shell: bash |
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,102 @@ | ||
name: build docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'release/*' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
builddocs: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: [3.7, 3.8, 3.9] | ||
exclude: | ||
- os: windows-latest | ||
python-version: 3.8 | ||
- os: windows-latest | ||
python-version: 3.9 | ||
env: | ||
DISPLAY: ':99.0' | ||
OS: ${{ matrix.os }} | ||
UPLOAD_TO_GHPAGES: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' && github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: '0' | ||
# if we upload to ghpages we need the full | ||
# history to generate correct version info | ||
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }} | ||
- uses: actions/[email protected] | ||
if: ${{ !fromJSON(env.UPLOAD_TO_GHPAGES) }} | ||
- name: setup ubuntu-latest xvfb | ||
uses: ./.github/actions/setup-ubuntu-latest-xvfb | ||
if: runner.os == 'Linux' | ||
- name: install pandoc linux | ||
run: sudo apt install pandoc | ||
if: runner.os == 'Linux' | ||
- name: Install pandoc on windows | ||
uses: crazy-max/[email protected] | ||
with: | ||
args: install pandoc | ||
if: runner.os == 'Windows' | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: prepare pip cache | ||
id: prepare-cache-pip | ||
uses: ./.github/actions/prepare-cache-pip | ||
- name: download requirements | ||
run: | | ||
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/requirements.txt > requirements.txt | ||
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/test_requirements.txt > test_requirements.txt | ||
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/docs_requirements.txt > docs_requirements.txt | ||
- name: pip cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }} | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/docs_requirements.txt') }}-${{ hashFiles('**/setup.cfg') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-pip- | ||
- name: install requirements.txt | ||
run: | | ||
pip install -r requirements.txt | ||
- name: install docs_requirements.txt | ||
run: | | ||
pip install -r docs_requirements.txt | ||
- name: install qcodes | ||
run: pip install . | ||
- name: Build docs on linux | ||
run: | | ||
cd docs | ||
export SPHINXOPTS="-W -v" | ||
make html | ||
if: runner.os == 'Linux' | ||
- name: Build docs on windows | ||
run: | | ||
cd docs | ||
$env:SPHINXOPTS = "-W -v" | ||
./make.bat html | ||
if: runner.os == 'Windows' | ||
- name: Upload build docs | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docs_${{ matrix.python-version }}_${{ matrix.os }} | ||
path: ${{ github.workspace }}/docs/_build/html | ||
- name: Deploy to gh pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: ${{ github.workspace }}/docs/_build/html | ||
clean: true | ||
single-commit: true | ||
git-config-email: "bot" | ||
git-config-name: "Documentation Bot" | ||
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }} |
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,78 @@ | ||
name: Run mypy and pytest | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'release/*' | ||
- 'staging' | ||
- 'trying' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
pytestmypy: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: [3.7, 3.8, 3.9] | ||
exclude: | ||
- os: windows-latest | ||
python-version: 3.8 | ||
- os: windows-latest | ||
python-version: 3.9 | ||
env: | ||
DISPLAY: ':99.0' | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
- name: setup ubuntu-latest xvfb | ||
uses: ./.github/actions/setup-ubuntu-latest-xvfb | ||
if: runner.os == 'Linux' | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: download requirements | ||
run: | | ||
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/requirements.txt > requirements.txt | ||
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/test_requirements.txt > test_requirements.txt | ||
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/docs_requirements.txt > docs_requirements.txt | ||
- name: prepare pip cache | ||
id: prepare-cache-pip | ||
uses: ./.github/actions/prepare-cache-pip | ||
- name: pip cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }} | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/test_requirements.txt') }}-${{ hashFiles('**/setup.cfg') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-pip- | ||
- name: install requirements.txt | ||
run: | | ||
pip install -r requirements.txt | ||
- name: install test_requirements.txt | ||
run: | | ||
pip install -r test_requirements.txt | ||
- name: install package | ||
run: | | ||
pip install . | ||
- name: Run Mypy | ||
run: mypy qcodes_contrib_drivers | ||
- name: Run tests | ||
run: | | ||
pytest --cov=qcodes_contrib_drivers --cov-report xml --cov-config=setup.cfg qcodes_contrib_drivers | ||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.xml | ||
env_vars: OS,PYTHON |
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,31 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.7' | ||
- name: Install build deps | ||
run: pip install --upgrade pip setuptools wheel build | ||
- name: Build | ||
run: | | ||
python -m build | ||
- name: Install Twine | ||
run: pip install twine | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
twine upload dist/* |
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 |
---|---|---|
|
@@ -107,3 +107,7 @@ venv.bak/ | |
|
||
#Pycharm | ||
.idea | ||
|
||
# System files | ||
*.DS_Store | ||
desktop.ini |
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.