FIX: remove pyansys logo from doc #356
Workflow file for this run
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
name: GitHub CI | |
on: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
env: | |
MAIN_PYTHON_VERSION: '3.10' | |
DOCUMENTATION_CNAME: 'pymeilisearch.docs.ansys.com' | |
LIBRARY_NAME: 'pymeilisearch' | |
LIBRARY_NAMESPACE: 'ansys.tools.meilisearch' | |
MEILISEARCH_API_PUBLIC_KEY: ${{ secrets.MEILISEARCH_API_PUBLIC_KEY }} | |
MEILISEARCH_HOST_URL: https://backend.search.pyansys.com | |
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-style: | |
name: "Code style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/code-style@v4 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
doc-style: | |
name: "Documentation style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/doc-style@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
smoke-tests: | |
name: Build and smoke tests | |
runs-on: ${{ matrix.os }} | |
needs: [code-style] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
should-release: | |
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }} | |
exclude: | |
- should-release: false | |
os: macos-latest | |
steps: | |
- name: "Build wheelhouse and perform smoke test" | |
uses: ansys/actions/build-wheelhouse@v4 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
library-namespace: ${{ env.LIBRARY_NAMESPACE }} | |
operating-system: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
tests: | |
name: "Tests docker image" | |
runs-on: ubuntu-latest | |
needs: [smoke-tests] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: Test the meilisearch container | |
working-directory: docker | |
run: docker-compose up -d | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install the project with testing dependencies | |
run: pip install .[tests] | |
- name: Run tests | |
run: pytest tests -vv | |
- name: Stop services | |
if: always() | |
working-directory: docker | |
run: docker-compose down | |
doc-build: | |
name: "Build documentation" | |
runs-on: ubuntu-latest | |
needs: [doc-style] | |
steps: | |
- uses: ansys/actions/doc-build@v4 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
build-library: | |
name: "Build library" | |
runs-on: ubuntu-latest | |
needs: [tests, doc-build] | |
steps: | |
- uses: ansys/actions/build-library@v4 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
release: | |
name: "Release project to private PyPI, public PyPI and GitHub" | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
needs: build-library | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Release to the private PyPI repository" | |
uses: ansys/actions/release-pypi-private@v4 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
twine-username: "__token__" | |
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | |
- name: "Release to the public PyPI repository" | |
uses: ansys/actions/release-pypi-public@v4 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
twine-username: "__token__" | |
twine-token: ${{ secrets.PYPI_TOKEN }} | |
- name: "Release to GitHub" | |
uses: ansys/actions/release-github@v4 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
upload_dev_docs: | |
name: Upload dev documentation | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: [build-library] | |
steps: | |
- name: Deploy the latest documentation | |
uses: ansys/actions/doc-deploy-dev@v4 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload_dev_docs_meilisearch: | |
name: Upload dev documentation to meilisearch | |
runs-on: ubuntu-latest | |
needs: [upload_dev_docs] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Install the package requirements | |
run: pip install -e . | |
- name: Scrape the dev documentation to meilisearch | |
run: | | |
pymeilisearch upload --template sphinx_pydata --index pymeilisearch-dev --cname ${{ env.DOCUMENTATION_CNAME }}/version/dev/ html documentation-html | |
upload_docs_release: | |
name: Upload release documentation | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Deploy the stable documentation | |
uses: ansys/actions/doc-deploy-stable@v4 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload_stable_docs_meilisearch: | |
name: Upload stable documentation to meilisearch | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
needs: [upload_docs_release] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Install the package requirements | |
run: pip install -e . | |
- name: Scrape the stable documentation to meilisearch | |
run: | | |
VERSION=$(python -c "from ansys.tools.meilisearch import __version__; print('.'.join(__version__.split('.')[:2]))") | |
pymeilisearch upload --template sphinx_pydata --index "pymeilisearch-${VERSION}" --cname "${{ env.DOCUMENTATION_CNAME }}/version/${VERSION}/" html documentation-html |