Skip to content

Commit

Permalink
Merge branch 'trunk' into 13910-fix-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
iampopovich authored Jun 22, 2024
2 parents 95ff511 + 14aa6db commit 311d79a
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 261 deletions.
6 changes: 6 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
exclude:
labels:
-dependencies
authors:
- selenium-ci
136 changes: 131 additions & 5 deletions .github/workflows/update-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,29 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Prep git
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
- name: Get updated Rakefile
run: |
git fetch origin auto_docs
git checkout origin/auto_docs -- Rakefile
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Update Documentation
run: ./go java:docs[true]
run: ./go java:docs
- name: Create patch for changes
run: |
git format-patch -1 HEAD --stdout > java-docs.patch
- name: Upload patch
uses: actions/upload-artifact@v2
with:
name: java-docs-patch
path: java-docs.patch

ruby-docs:
runs-on: ubuntu-latest
Expand All @@ -34,13 +50,29 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Prep git
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
- name: Get updated Rakefile
run: |
git fetch origin auto_docs
git checkout origin/auto_docs -- Rakefile
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Update Documentation
run: ./go ruby:docs[true]
run: ./go rb:docs
- name: Create patch for changes
run: |
git format-patch -1 HEAD --stdout > ruby-docs.patch
- name: Upload patch
uses: actions/upload-artifact@v2
with:
name: ruby-docs-patch
path: ruby-docs.patch

python-docs:
runs-on: ubuntu-latest
Expand All @@ -49,12 +81,32 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Prep git
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
- name: Get updated Rakefile
run: |
git fetch origin auto_docs
git checkout origin/auto_docs -- Rakefile
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Update Documentation
run: ./go py:docs[true]
run: ./go py:docs
- name: Create patch for changes
run: |
git format-patch -1 HEAD --stdout > python-docs.patch
- name: Upload patch
uses: actions/upload-artifact@v2
with:
name: python-docs-patch
path: python-docs.patch

dotnet-docs:
runs-on: ubuntu-latest
Expand All @@ -63,12 +115,28 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Prep git
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
- name: Get updated Rakefile
run: |
git fetch origin auto_docs
git checkout origin/auto_docs -- Rakefile
- name: Install specific version of DocFX tool
# Pinning to 2.75.3 to avoid breaking changes in newer versions
# See https://github.com/dotnet/docfx/issues/9855
run: dotnet tool install --global --version 2.75.3 docfx
- name: Update Documentation
run: ./go dotnet:docs[true]
run: ./go dotnet:docs
- name: Create patch for changes
run: |
git format-patch -1 HEAD --stdout > dotnet-docs.patch
- name: Upload patch
uses: actions/upload-artifact@v2
with:
name: dotnet-docs-patch
path: dotnet-docs.patch

node-docs:
runs-on: ubuntu-latest
Expand All @@ -77,9 +145,67 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Prep git
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
- name: Get updated Rakefile
run: |
git fetch origin auto_docs
git checkout origin/auto_docs -- Rakefile
- name: Install npm dependencies
run: |
npm install
npm install --prefix javascript/node/selenium-webdriver
- name: Update Documentation
run: ./go node:docs[true]
run: ./go node:docs
- name: Create patch for changes
run: |
git format-patch -1 HEAD --stdout > node-docs.patch
- name: Upload patch
uses: actions/upload-artifact@v2
with:
name: node-docs-patch
path: node-docs.patch

merge-patches:
runs-on: ubuntu-latest
needs: [java-docs, ruby-docs, python-docs, dotnet-docs, node-docs]
steps:
- name: Checkout documentation branch
uses: actions/checkout@v4
with:
ref: 'gh-pages'
- name: Create and checkout new branch
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
git checkout -b api-docs-${{ inputs.tag }}
- name: Download patches
uses: actions/download-artifact@v2
with:
name: java-docs-patch
path: patches/
- uses: actions/download-artifact@v2
with:
name: ruby-docs-patch
path: patches/
- uses: actions/download-artifact@v2
with:
name: python-docs-patch
path: patches/
- uses: actions/download-artifact@v2
with:
name: dotnet-docs-patch
path: patches/
- uses: actions/download-artifact@v2
with:
name: node-docs-patch
path: patches/
- name: Apply patches
run: |
for patch in patches/*.patch; do
git am < "$patch"
done
- name: Push Branch
run: git push origin api-docs-${{ inputs.tag }}
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,40 @@ to check that your approach aligns with the project's
ideas. Nothing is more frustrating than seeing your hard work go to
waste because your vision doesn't align with the project's.

#### Dependencies Managed by Bazel

##### Java

Edit `MODULE.bazel`, and either update or add the dependency you want
using the regular maven coordinates to the `maven.install` with the
name `maven`. Once done, run `REPIN=1 bazel run @maven//:pin` to
update the lock file, create a PR and check the change in.

##### JS

We use `pnpm` for JS development in the project, and we also use [pnpm
workspaces](https://pnpm.io/workspaces). Take a look at the top-level
`pnpm-workspace.yaml` file to find them all, but the main thing to
know is that each of the workspaces has its own `package.json`. You
can add dependencies to specific workspaces either by using `pnpm`
installed on your local machine, or by executing:

```shell
# Example of adding a dep to the JS webdriver bindings
cd javascript/node/selenium-webdriver
bazel run javascript:pnpm -- install my-amazing-dep --dir $PWD
```

This will install the dependency using the same version of `pnpm` we
build the project with for a single JS project.

To update all dependencies in the tree to the latest version:

`bazel run javascript:pnpm -- -r up --dir $PWD`

This will also update the lock file, so once a change is made, create
a PR and commit all the changed files.

#### License Headers

Every file in the Selenium project must carry the following license
Expand Down
3 changes: 3 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ linter.register(name = "rust-rustfmt")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "18.17.0")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
Expand Down
Loading

0 comments on commit 311d79a

Please sign in to comment.