Skip to content

Commit 6e44fda

Browse files
authored
update RTD config, move doc deps into their own group, update dev group (#2381)
* update RTD config, move doc deps into their own group, update dev group * remove use of `--extras docs` from gh actions * better filter when functional tests run by add an `info` job this new job produces outputs that can be used by other jobs to determine if they should run or not making it easier to skip jobs on/from forks that can't run on/from forks. * Spell Check workflow trigger match CI/CD workflow trigger the PR for this change is stuck waiting for the "Spell Check" workflow to run. this could be caused by the trigger only being defined for pushed events and this being from a fork where actions don't run. * remove `.` from workflow name
1 parent 65d6882 commit 6e44fda

9 files changed

+104
-78
lines changed

.github/workflows/cicd.yml

+41-12
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,41 @@ jobs:
4848
- 'infrastructure/blueprints/prevent_privilege_escalation.py'
4949
- 'infrastructure/blueprints/test_runner_boundary.py'
5050
- 'infrastructure/test-alt/common/**'
51+
info:
52+
name: Output useful information
53+
runs-on: ubuntu-latest
54+
outputs:
55+
is-actor-bot: ${{ steps.gh-context.outputs.is-actor-bot }} # if the actor (user) is a bot
56+
is-fork: ${{ steps.gh-context.outputs.is-fork }} # if the action is running in or from (PR) a fork
57+
repo-head: ${{ steps.gh-context.outputs.repo-head }} # repo where change occurred
58+
repo-origin: ${{ steps.gh-context.outputs.repo-origin }} # origin of codebase
59+
steps:
60+
- name: Output GitHub Context
61+
id: gh-context
62+
run: |
63+
export _REPO_ORIGIN="onicagroup/runway";
64+
echo "repo-origin=${_REPO_ORIGIN}" >> "${GITHUB_OUTPUT}";
65+
export _REPO_HEAD="${{ github.event.pull_request.head.repo.full_name || github.repository }}";
66+
echo "repo-head=${_REPO_HEAD}" >> "${GITHUB_OUTPUT}";
67+
if [[ "${_REPO_HEAD}" == "${_REPO_ORIGIN}" ]]; then
68+
echo "is-fork=false" >> "${GITHUB_OUTPUT}";
69+
else
70+
echo "is-fork=true" >> "${GITHUB_OUTPUT}";
71+
fi;
72+
if [[ ${{ github.actor }} == *"[bot]" ]]; then
73+
echo "is-actor-bot=true" >> "${GITHUB_OUTPUT}";
74+
else
75+
echo "is-actor-bot=false" >> "${GITHUB_OUTPUT}";
76+
fi;
5177
deploy-test-infrastructure:
5278
name: Deploy Test Infrastructure
5379
environment: test
5480
concurrency: test-infrastructure
55-
needs: changes
81+
needs:
82+
- changes
83+
- info
5684
if: |
57-
github.repository == 'onicagroup/runway' &&
85+
needs.info.outputs.is-fork == 'false' &&
5886
(needs.changes.outputs.infra-test == 'true' || needs.changes.outputs.infra-test-alt == 'true')
5987
runs-on: ubuntu-latest
6088
steps:
@@ -73,7 +101,7 @@ jobs:
73101
- name: Ensure Cache Is Healthy
74102
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
75103
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
76-
- run: poetry install --extras docs -vv
104+
- run: poetry install -vv
77105
- name: Configure AWS Credentials
78106
uses: aws-actions/configure-aws-credentials@v4
79107
with:
@@ -115,7 +143,7 @@ jobs:
115143
- name: Ensure Cache Is Healthy
116144
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
117145
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
118-
- run: poetry install --extras docs -vv
146+
- run: poetry install -vv
119147
- name: Install Node Dependencies
120148
run: make npm-ci
121149
- name: Run Linters
@@ -141,16 +169,17 @@ jobs:
141169
- name: Ensure Cache Is Healthy
142170
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
143171
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
144-
- run: poetry install --extras docs -vv
172+
- run: poetry install -vv
145173
- uses: pre-commit/[email protected]
146174
test-functional:
147175
name: Functional Tests
148-
needs: deploy-test-infrastructure
149-
# will fail if run from forks
176+
needs:
177+
- deploy-test-infrastructure
178+
- info
150179
if: |
151180
always() &&
152-
github.repository == 'onicagroup/runway' &&
153-
github.actor != 'dependabot[bot]' &&
181+
needs.info.outputs.is-fork == 'false' &&
182+
needs.info.outputs.is-actor-bot == 'false' &&
154183
(needs.deploy-test-infrastructure.result == 'success' || needs.deploy-test-infrastructure.result == 'skipped')
155184
runs-on: ubuntu-latest
156185
steps:
@@ -172,7 +201,7 @@ jobs:
172201
- name: Ensure Cache Is Healthy
173202
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
174203
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
175-
- run: poetry install --extras docs -vv
204+
- run: poetry install -vv
176205
- name: Install Ubuntu Dependencies
177206
run: |
178207
sudo apt update -y
@@ -218,7 +247,7 @@ jobs:
218247
- name: Ensure Cache Is Healthy
219248
if: steps.cache.outputs.cache-hit == 'true'
220249
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
221-
- run: poetry install --extras docs -vv
250+
- run: poetry install -vv
222251
- name: Install Node Dependencies
223252
run: make npm-install
224253
- name: Configure Pagefile # avoid MemoryError during tests
@@ -266,7 +295,7 @@ jobs:
266295
- name: Ensure Cache Is Healthy
267296
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
268297
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
269-
- run: poetry install --extras docs -vv
298+
- run: poetry install -vv
270299
- name: Run Build
271300
run: make build
272301
- name: Upload Distribution Artifact

.github/workflows/on-push-pyinstaller.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Ensure Cache Is Healthy
6161
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
6262
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
63-
- run: poetry install --extras docs -vv
63+
- run: poetry install -vv
6464
- name: Run Build
6565
run: make build-pyinstaller-file
6666
- name: Upload Artifacts
@@ -110,7 +110,7 @@ jobs:
110110
- name: Ensure Cache Is Healthy
111111
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
112112
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
113-
- run: poetry install --extras docs -vv
113+
- run: poetry install -vv
114114
- name: Run Build
115115
run: make build-pyinstaller-folder
116116
- name: Upload Artifacts
@@ -171,7 +171,7 @@ jobs:
171171
- name: Ensure Cache Is Healthy
172172
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
173173
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
174-
- run: poetry install --extras docs -vv
174+
- run: poetry install -vv
175175
- name: Download Artifacts (macOS)
176176
if: steps.check_distance.outcome == 'success'
177177
uses: actions/download-artifact@v4

.github/workflows/publish-on-release.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Ensure Cache Is Healthy
5555
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
5656
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
57-
- run: poetry install --extras docs -vv
57+
- run: poetry install -vv
5858
- name: Run Build
5959
run: make build-pyinstaller-file
6060
- name: Upload Artifacts
@@ -105,7 +105,7 @@ jobs:
105105
- name: Ensure Cache Is Healthy
106106
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
107107
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
108-
- run: poetry install --extras docs -vv
108+
- run: poetry install -vv
109109
- name: Run Build
110110
run: make build-pyinstaller-folder
111111
- name: Upload Artifacts
@@ -158,7 +158,7 @@ jobs:
158158
- name: Ensure Cache Is Healthy
159159
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
160160
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
161-
- run: poetry install --extras docs -vv
161+
- run: poetry install -vv
162162
- name: Download Artifacts (macOS)
163163
uses: actions/download-artifact@v4
164164
with:
@@ -246,7 +246,7 @@ jobs:
246246
- name: Ensure Cache Is Healthy
247247
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
248248
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
249-
- run: poetry install --extras docs -vv
249+
- run: poetry install -vv
250250
- name: Run Build
251251
run: make build
252252
- name: Upload Distribution Artifact
@@ -282,7 +282,7 @@ jobs:
282282
- name: Ensure Cache Is Healthy
283283
if: steps.cache.outputs.cache-hit == 'true'
284284
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
285-
- run: poetry install --extras docs -vv
285+
- run: poetry install -vv
286286
- run: make version
287287
- name: Publish Distribution 📦 to PyPI
288288
env:
@@ -349,7 +349,7 @@ jobs:
349349
- name: Ensure Cache Is Healthy
350350
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
351351
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
352-
- run: poetry install --extras docs -vv
352+
- run: poetry install -vv
353353
- name: Configure AWS Credentials
354354
uses: aws-actions/configure-aws-credentials@v4
355355
with:

.github/workflows/spell-check.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ name: Spell Check
33
# There is an official action published by cSpell.
44
# v1.1.1 was tested but did not function as desired so we are using the CLI.
55

6-
on: push
7-
6+
on:
7+
pull_request: # any pull request
8+
push:
9+
branches:
10+
- master
811

912
env:
1013
NODE_VERSION: '18'
1114

12-
1315
jobs:
1416
spell-check:
1517
runs-on: ubuntu-latest

.readthedocs.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10+
jobs:
11+
post_create_environment:
12+
# Install poetry
13+
# https://python-poetry.org/docs/#installing-manually
14+
- pip install poetry
15+
post_install:
16+
# Install dependencies with 'docs' dependency group
17+
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
18+
# VIRTUAL_ENV needs to be set manually for now.
19+
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
20+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs,types
1021
os: ubuntu-22.04
1122
tools:
12-
python: '3.9'
23+
python: '3.12'
1324

1425
# Optionally build your docs in additional formats such as PDF and ePub
1526
formats: all

.vscode/settings.json

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"restructuredtext"
1515
],
1616
"cSpell.enabled": true,
17+
"esbonio.sphinx.buildDir": "${workspaceRoot}/docs/build",
18+
"esbonio.sphinx.confDir": "${workspaceFolder}/docs/source",
1719
"explorerExclude.backup": null,
1820
"files.exclude": {
1921
"**/*.egg-info": true,

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ setup: setup-poetry setup-pre-commit setup-npm ## setup development environment
124124
setup-npm: npm-ci ## install node dependencies with npm
125125

126126
setup-poetry: ## setup python virtual environment
127-
@poetry install \
128-
--extras docs \
129-
--sync
127+
@poetry install --sync
130128

131129
setup-pre-commit: ## install pre-commit git hooks
132130
@poetry run pre-commit install

0 commit comments

Comments
 (0)