4 files changed, 74 insertions, 1 deletions
diff --git a/.github/workflows/docs-pr-netlify.yaml b/.github/workflows/docs-pr-netlify.yaml
index b443cd87d1..8b20322308 100644
--- a/.github/workflows/docs-pr-netlify.yaml
+++ b/.github/workflows/docs-pr-netlify.yaml
@@ -22,7 +22,7 @@ jobs:
path: book
- name: 📤 Deploy to Netlify
- uses: matrix-org/netlify-pr-preview@v2
+ uses: matrix-org/netlify-pr-preview@v3
with:
path: book
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
diff --git a/.github/workflows/docs-pr.yaml b/.github/workflows/docs-pr.yaml
index 3704bd66e2..9cf3d340a4 100644
--- a/.github/workflows/docs-pr.yaml
+++ b/.github/workflows/docs-pr.yaml
@@ -6,6 +6,7 @@ on:
- docs/**
- book.toml
- .github/workflows/docs-pr.yaml
+ - scripts-dev/schema_versions.py
jobs:
pages:
@@ -13,12 +14,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ with:
+ # Fetch all history so that the schema_versions script works.
+ fetch-depth: 0
- name: Setup mdbook
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
with:
mdbook-version: '0.4.17'
+ - name: Setup python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.x"
+
+ - run: "pip install 'packaging>=20.0' 'GitPython>=3.1.20'"
+
- name: Build the documentation
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
# However, we're using docs/README.md for other purposes and need to pick a new page
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
index c7cb2d78e5..31b9dbe3fe 100644
--- a/.github/workflows/docs.yaml
+++ b/.github/workflows/docs.yaml
@@ -51,12 +51,22 @@ jobs:
- pre
steps:
- uses: actions/checkout@v4
+ with:
+ # Fetch all history so that the schema_versions script works.
+ fetch-depth: 0
- name: Setup mdbook
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
with:
mdbook-version: '0.4.17'
+ - name: Setup python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.x"
+
+ - run: "pip install 'packaging>=20.0' 'GitPython>=3.1.20'"
+
- name: Build the documentation
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
# However, we're using docs/README.md for other purposes and need to pick a new page
diff --git a/.github/workflows/fix_lint.yaml b/.github/workflows/fix_lint.yaml
new file mode 100644
index 0000000000..f1e35fcd99
--- /dev/null
+++ b/.github/workflows/fix_lint.yaml
@@ -0,0 +1,52 @@
+# A helper workflow to automatically fixup any linting errors on a PR. Must be
+# triggered manually.
+
+name: Attempt to automatically fix linting errors
+
+on:
+ workflow_dispatch:
+
+jobs:
+ fixup:
+ name: Fix up
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Install Rust
+ uses: dtolnay/rust-toolchain@master
+ with:
+ # We use nightly so that `fmt` correctly groups together imports, and
+ # clippy correctly fixes up the benchmarks.
+ toolchain: nightly-2022-12-01
+ components: rustfmt
+ - uses: Swatinem/rust-cache@v2
+
+ - name: Setup Poetry
+ uses: matrix-org/setup-python-poetry@v1
+ with:
+ install-project: "false"
+
+ - name: Import order (isort)
+ continue-on-error: true
+ run: poetry run isort .
+
+ - name: Code style (black)
+ continue-on-error: true
+ run: poetry run black .
+
+ - name: Semantic checks (ruff)
+ continue-on-error: true
+ run: poetry run ruff --fix .
+
+ - run: cargo clippy --all-features --fix -- -D warnings
+ continue-on-error: true
+
+ - run: cargo fmt
+ continue-on-error: true
+
+ - uses: stefanzweifel/git-auto-commit-action@v5
+ with:
+ commit_message: "Attempt to fix linting"
|