Skip to content

Commit

Permalink
update RTD config, move doc deps into their own group, update dev gro…
Browse files Browse the repository at this point in the history
…up (#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
  • Loading branch information
ITProKyle authored Jun 26, 2024
1 parent 65d6882 commit 6e44fda
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 78 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,41 @@ jobs:
- 'infrastructure/blueprints/prevent_privilege_escalation.py'
- 'infrastructure/blueprints/test_runner_boundary.py'
- 'infrastructure/test-alt/common/**'
info:
name: Output useful information
runs-on: ubuntu-latest
outputs:
is-actor-bot: ${{ steps.gh-context.outputs.is-actor-bot }} # if the actor (user) is a bot
is-fork: ${{ steps.gh-context.outputs.is-fork }} # if the action is running in or from (PR) a fork
repo-head: ${{ steps.gh-context.outputs.repo-head }} # repo where change occurred
repo-origin: ${{ steps.gh-context.outputs.repo-origin }} # origin of codebase
steps:
- name: Output GitHub Context
id: gh-context
run: |
export _REPO_ORIGIN="onicagroup/runway";
echo "repo-origin=${_REPO_ORIGIN}" >> "${GITHUB_OUTPUT}";
export _REPO_HEAD="${{ github.event.pull_request.head.repo.full_name || github.repository }}";
echo "repo-head=${_REPO_HEAD}" >> "${GITHUB_OUTPUT}";
if [[ "${_REPO_HEAD}" == "${_REPO_ORIGIN}" ]]; then
echo "is-fork=false" >> "${GITHUB_OUTPUT}";
else
echo "is-fork=true" >> "${GITHUB_OUTPUT}";
fi;
if [[ ${{ github.actor }} == *"[bot]" ]]; then
echo "is-actor-bot=true" >> "${GITHUB_OUTPUT}";
else
echo "is-actor-bot=false" >> "${GITHUB_OUTPUT}";
fi;
deploy-test-infrastructure:
name: Deploy Test Infrastructure
environment: test
concurrency: test-infrastructure
needs: changes
needs:
- changes
- info
if: |
github.repository == 'onicagroup/runway' &&
needs.info.outputs.is-fork == 'false' &&
(needs.changes.outputs.infra-test == 'true' || needs.changes.outputs.infra-test-alt == 'true')
runs-on: ubuntu-latest
steps:
Expand All @@ -73,7 +101,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down Expand Up @@ -115,7 +143,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Install Node Dependencies
run: make npm-ci
- name: Run Linters
Expand All @@ -141,16 +169,17 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- uses: pre-commit/[email protected]
test-functional:
name: Functional Tests
needs: deploy-test-infrastructure
# will fail if run from forks
needs:
- deploy-test-infrastructure
- info
if: |
always() &&
github.repository == 'onicagroup/runway' &&
github.actor != 'dependabot[bot]' &&
needs.info.outputs.is-fork == 'false' &&
needs.info.outputs.is-actor-bot == 'false' &&
(needs.deploy-test-infrastructure.result == 'success' || needs.deploy-test-infrastructure.result == 'skipped')
runs-on: ubuntu-latest
steps:
Expand All @@ -172,7 +201,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Install Ubuntu Dependencies
run: |
sudo apt update -y
Expand Down Expand Up @@ -218,7 +247,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Install Node Dependencies
run: make npm-install
- name: Configure Pagefile # avoid MemoryError during tests
Expand Down Expand Up @@ -266,7 +295,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Run Build
run: make build
- name: Upload Distribution Artifact
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/on-push-pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Run Build
run: make build-pyinstaller-file
- name: Upload Artifacts
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Run Build
run: make build-pyinstaller-folder
- name: Upload Artifacts
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Download Artifacts (macOS)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Run Build
run: make build-pyinstaller-file
- name: Upload Artifacts
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Run Build
run: make build-pyinstaller-folder
- name: Upload Artifacts
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Download Artifacts (macOS)
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Run Build
run: make build
- name: Upload Distribution Artifact
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- run: make version
- name: Publish Distribution 📦 to PyPI
env:
Expand Down Expand Up @@ -349,7 +349,7 @@ jobs:
- name: Ensure Cache Is Healthy
if: runner.os != 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- run: poetry install --extras docs -vv
- run: poetry install -vv
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: Spell Check
# There is an official action published by cSpell.
# v1.1.1 was tested but did not function as desired so we are using the CLI.

on: push

on:
pull_request: # any pull request
push:
branches:
- master

env:
NODE_VERSION: '18'


jobs:
spell-check:
runs-on: ubuntu-latest
Expand Down
13 changes: 12 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ version: 2

# Set the version of Python and other tools you might need
build:
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs,types
os: ubuntu-22.04
tools:
python: '3.9'
python: '3.12'

# Optionally build your docs in additional formats such as PDF and ePub
formats: all
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"restructuredtext"
],
"cSpell.enabled": true,
"esbonio.sphinx.buildDir": "${workspaceRoot}/docs/build",
"esbonio.sphinx.confDir": "${workspaceFolder}/docs/source",
"explorerExclude.backup": null,
"files.exclude": {
"**/*.egg-info": true,
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ setup: setup-poetry setup-pre-commit setup-npm ## setup development environment
setup-npm: npm-ci ## install node dependencies with npm

setup-poetry: ## setup python virtual environment
@poetry install \
--extras docs \
--sync
@poetry install --sync

setup-pre-commit: ## install pre-commit git hooks
@poetry run pre-commit install
Expand Down
Loading

0 comments on commit 6e44fda

Please sign in to comment.