Skip to content

Update secrets needed for running remote tests. #2

Update secrets needed for running remote tests.

Update secrets needed for running remote tests. #2

Workflow file for this run

name: Build and test
on:
push:
branches:
- 'wheel/**'
release:
types:
- created
- edited
jobs:
checks:
name: Build and test module
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build and test
shell: bash
env:
PYTKET_RUN_REMOTE_TESTS: 1
AZURE_QUANTUM_CONNECTION_STRING: ${{ secrets.AZURE_QUANTUM_CONNECTION_STRING }}
run: ./.github/workflows/build-test mypy
- name: Install docs dependencies
run: pip install -r .github/workflows/docs/requirements.txt
- name: Build docs
timeout-minutes: 20
run: ./.github/workflows/docs/check-build-docs
- uses: actions/upload-artifact@v4
if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel')
with:
name: wheel
path: wheelhouse/
publish_to_pypi:
name: Publish to pypi
if: github.event_name == 'release'
needs: checks
runs-on: 'ubuntu-latest'
steps:
- name: Download wheel
uses: actions/download-artifact@v4
with:
path: wheelhouse
name: wheel
- name: Put it in the dist folder
run: |
mkdir dist
for w in `find wheelhouse/ -type f -name "*.whl"` ; do cp $w dist/ ; done
- name: Publish wheel
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PYTKET_AZURE_API_TOKEN }}
verbose: true
build_docs:
name: Build docs
if: github.event_name == 'release'
needs: publish_to_pypi
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Download wheel
uses: actions/download-artifact@v4
with:
path: wheelhouse
- name: Install extension
run: for w in `find wheelhouse/ -type f -name "*.whl"` ; do pip install $w ; done
- name: Install docs dependencies
run: |
pip install -r .github/workflows/docs/requirements.txt
- name: Build docs
timeout-minutes: 20
run: |
cd .github/workflows/docs
mkdir extensions
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api
- name: Upload docs as artefact
uses: actions/upload-pages-artifact@v3
with:
path: .github/workflows/docs/extensions
publish_docs:
name: Publish docs
if: github.event_name == 'release'
needs: build_docs
runs-on: 'ubuntu-latest'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]