Skip to content

Commit 226dbf6

Browse files
committed
Add .circleci/config.yml
1 parent 2724a35 commit 226dbf6

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

.circleci/config.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Use the latest 2.1 version of CircleCI pipeline process engine.
2+
# See: https://circleci.com/docs/2.0/configuration-reference
3+
version: 2.1
4+
5+
# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
6+
# See: https://circleci.com/docs/2.0/orb-intro/
7+
orbs:
8+
# The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files
9+
# Orb commands and jobs help you with common scripting around a language/tool
10+
# so you dont have to copy and paste it everywhere.
11+
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
12+
python: circleci/python@1.5.0
13+
14+
# Define a job to be invoked later in a workflow.
15+
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
16+
jobs:
17+
build-docs: # This is the name of the job, feel free to change it to better match what you're trying to do!
18+
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
19+
# You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
20+
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
21+
# The executor is the environment in which the steps below will be executed - below will use a python 3.10.2 container
22+
# Change the version below to your required version of python
23+
docker:
24+
- image: cimg/python:3.10.2
25+
# Checkout the code as the first step. This is a dedicated CircleCI step.
26+
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
27+
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
28+
# Then run your tests!
29+
# CircleCI will report the results back to your VCS provider.
30+
steps:
31+
- checkout
32+
- run:
33+
name: Install qt libs + xvfb
34+
command: sudo apt-get update && sudo apt-get install -y xvfb libegl1 libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 x11-utils
35+
36+
- run:
37+
name: Install python dependencies
38+
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
39+
command: |
40+
python -m venv venv
41+
. venv/bin/activate
42+
python -m pip install --upgrade pip
43+
python -m pip install -r requirements.txt
44+
- run:
45+
name: Clone main repo
46+
command: git clone git@github.com:napari/napari.git napari
47+
- run:
48+
name: Install napari-dev
49+
command: |
50+
. venv/bin/activate
51+
python -m pip install -e napari/".[pyside,dev]"
52+
- run:
53+
name: Build docs
54+
command: |
55+
. venv/bin/activate
56+
xvfb-run --auto-servernum make docs-build GALLERY_PATH=../napari/examples/
57+
- store_artifacts:
58+
path: docs/_build/
59+
- persist_to_workspace:
60+
root: .
61+
paths:
62+
- docs/_build/
63+
64+
# Invoke jobs via workflows
65+
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
66+
workflows:
67+
build-docs: # This is the name of the workflow, feel free to change it to better match your workflow.
68+
# Inside the workflow, you define the jobs you want to run.
69+
jobs:
70+
- build-docs

.github/workflows/circleci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# To enable this workflow on a fork, comment out:
2+
#
3+
# if: github.repository == 'napari/docs'
4+
5+
name: CircleCI artifact redirector
6+
7+
on: [status]
8+
jobs:
9+
circleci_artifacts_redirector_job:
10+
runs-on: ubuntu-latest
11+
if: "github.event.context == 'ci/circleci: build-docs'"
12+
permissions:
13+
statuses: write
14+
name: Run CircleCI artifacts redirector
15+
# if: github.repository == 'napari/docs'
16+
steps:
17+
- name: GitHub Action step
18+
uses: larsoner/circleci-artifacts-redirector-action@master
19+
with:
20+
repo-token: ${{ secrets.CIRCLECI_TOKEN }}
21+
artifact-path: 0/docs/_build/index.html
22+
circleci-jobs: build-docs
23+
job-title: Check the rendered docs here!

0 commit comments

Comments
 (0)