Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
31 changes: 31 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
paths:
- "pkg-r/**"
- ".github/workflows/R-CMD-check.yaml"
pull_request:
paths:
- "pkg-r/**"
- ".github/workflows/R-CMD-check.yaml"

name: R-CMD-check.yaml

permissions: read-all

jobs:
routine:
uses: rstudio/shiny-workflows/.github/workflows/routine.yaml@v1
permissions:
contents: write
with:
working-directory: pkg-r
format-r-code: true
check-js: false
R-CMD-check:
uses: rstudio/shiny-workflows/.github/workflows/R-CMD-check.yaml@v1
with:
working-directory: pkg-r
extra-check-build-args: '"--compact-vignettes=gs+qpdf"'
66 changes: 66 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
paths:
- 'pkg-r/man/**/*'
- 'pkg-r/vignettes/**/*'
- 'pkg-r/pkgdown/**/*'
- '.github/workflows/pkgdown.yaml'
pull_request:
paths:
- 'pkg-r/man/**/*'
- 'pkg-r/vignettes/**/*'
- 'pkg-r/pkgdown/**/*'
- '.github/workflows/pkgdown.yaml'
release:
types: [published]
workflow_dispatch:

name: pkgdown.yaml

permissions:
contents: write

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write

# Only run on release events for tags start with "r/v*"
if: github.event_name != 'release' || startsWith(github.ref, 'refs/tags/r/v')

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
working-directory: pkg-r

- name: Build site
working-directory: pkg-r
shell: Rscript {0}
run: pkgdown::build_site()

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
59 changes: 59 additions & 0 deletions .github/workflows/py-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: py-check.yaml

on:
push:
branches: [main]
paths:
- 'pkg-py/**/*'
- 'pyproject.toml'
- '.github/workflows/py-check.yaml'
pull_request:
paths:
- 'pkg-py/**/*'
- 'pyproject.toml'
- '.github/workflows/py-check.yaml'

permissions:
contents: read

env:
UV_VERSION: "0.9.x"

jobs:
py-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- uses: actions/checkout@v4

- name: 🚀 Install uv
uses: astral-sh/setup-uv@v6.1.0
with:
version: ${{ env.UV_VERSION }}

- name: 🐍 Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: 📦 Install the project
run: uv sync --python ${{ matrix.python-version }} --all-extras --all-groups

- name: 📜 Show uv.lock
run: cat uv.lock

- name: 🧪 Check tests
run: make py-check-tests

- name: 📝 Check types
run: make py-check-types

- name: 📐 Check formatting
run: make py-check-format
54 changes: 54 additions & 0 deletions .github/workflows/py-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: py-release.yaml

on:
release:
types: [published]

env:
UV_VERSION: "0.9.x"
PYTHON_VERSION: 3.13

jobs:
py-release:
name: Build and release Python package
runs-on: ubuntu-latest

# Python release tags start with "py/v*"
if: startsWith(github.ref, 'refs/tags/py/v')

environment:
name: pypi
url: https://pypi.org/project/shinyjson/

permissions: # for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v4

- name: 🚀 Install uv
uses: astral-sh/setup-uv@v3
with:
version: ${{ env.UV_VERSION }}

- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
run: uv python install ${{ env.PYTHON_VERSION }}

- name: 📦 Install the project
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras --all-groups

- name: 📝 Check types
run: make py-check-types

- name: 📐 Check formatting
run: make py-check-format

- name: 🧪 Check tests
run: make py-check-tests

- name: 🧳 Build package
run: uv build

# TODO: https://pypi.org/manage/project/shinyjson/settings/publishing/
- name: 🚢 Publish release on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
64 changes: 64 additions & 0 deletions .github/workflows/quartodoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
branches:
- main
paths:
- "docs/**/*"
- "pkg-py/**/*"
- .github/workflows/quartodoc.yaml
workflow_dispatch:

name: quartodoc.yaml

permissions:
contents: write

env:
UV_VERSION: "0.9.x"
PYTHON_VERSION: 3.13
QUARTO_VERSION: 1.7.31

jobs:
docs-publish:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history needed for correct versioning of py pkg

- name: 🔵 Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: ${{ env.QUARTO_VERSION }}

- name: 🚀 Install uv
uses: astral-sh/setup-uv@v6.1.0
with:
version: ${{ env.UV_VERSION }}

- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
run: uv python install ${{ env.PYTHON_VERSION }}

- name: 📦 Install shinyjson and dependencies
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras --all-groups

- name: 🔌 Activate venv
run: |
source .venv/bin/activate
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV

- name: 🏭 Update Python docs
run: |
make py-docs-api
quarto render pkg-py/docs

- name: 🚢 Deploy to GitHub pages
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
folder: docs
branch: gh-pages
53 changes: 53 additions & 0 deletions .github/workflows/verify-js-built.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: verify-js-built.yaml

on:
push:
branches: ["main", "rc-*"]
paths:
- "js/**/*"
- .github/workflows/verify-js-built.yaml
pull_request:
paths:
- "js/**/*"
- .github/workflows/verify-js-built.yaml

jobs:
verify_js_built:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🔎 Extract node version from .nvmrc
id: nvm
working-directory: js
run: |
echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: 🟡 Use Node.js
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvm.outputs.version }}"

- name: 🆙 Install dependencies
run: make js-setup-ci
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: 🏭 Build
run: make js-build

- name: 🧐 Check for uncommitted changes
run: |
if [[ `git status --porcelain` ]]; then
git diff
echo "Uncommitted changes found. Please commit any changes that result from 'make js-setup-ci js-build'."
exit 1
else
echo "No uncommitted changes found."
fi
working-directory: js
Loading
Loading