Skip to content
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# TODO: Enable when R package is implemented (has DESCRIPTION file).
# Uncomment the on: block below and remove the workflow_dispatch-only trigger.
#
# on:
# push:
# branches: [main]
# 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

on:
workflow_dispatch:

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
69 changes: 69 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# TODO: Enable when R pkgdown is configured.
# Uncomment the on: block below and remove the workflow_dispatch-only trigger.
#
# on:
# push:
# branches: [main]
# 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

on:
workflow_dispatch:

permissions:
contents: write

jobs:
pkgdown:
runs-on: ubuntu-latest
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 starting 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
60 changes: 60 additions & 0 deletions .github/workflows/py-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# TODO: Enable when PyPI project is created.
# Uncomment the on: block below and remove the workflow_dispatch-only trigger.
# Set up trusted publishing at: https://pypi.org/manage/project/shinyjson/settings/publishing/
#
# on:
# release:
# types: [published]

name: py-release.yaml

on:
workflow_dispatch:

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:
id-token: write

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 ${{ 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

- name: 🚢 Publish release on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
70 changes: 70 additions & 0 deletions .github/workflows/quartodoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# TODO: Enable when quartodoc is configured in pkg-py/docs/.
# Uncomment the on: block below and remove the workflow_dispatch-only trigger.
#
# on:
# push:
# branches:
# - main
# paths:
# - "docs/**/*"
# - "pkg-py/**/*"
# - ".github/workflows/quartodoc.yaml"
# workflow_dispatch:

name: quartodoc.yaml

on:
workflow_dispatch:

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

- 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
48 changes: 48 additions & 0 deletions .github/workflows/verify-conventional-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Conventional Commits
on:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
build
chore
ci
docs
feat
fix
perf
refactor
release
style
test
- uses: marocchino/sticky-pull-request-comment@v2
if: always() && (steps.lint.outputs.error_message != null)
with:
header: lint-error
message: |
Hey there! 👋

We noticed that the title of your pull request doesn't follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. To ensure consistency, we kindly ask you to adjust the title accordingly.

<details><summary>Additional details</summary>

${{ steps.lint.outputs.error_message }}

</details>

- if: ${{ steps.lint.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: lint-error
delete: true
51 changes: 51 additions & 0 deletions .github/workflows/verify-js-built.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: verify-js-built.yaml

on:
push:
branches: [main]
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

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