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
5 changes: 5 additions & 0 deletions .github/actions/setup-rust/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

# Changelog

## v1.0.4

- Optionally install SQLite development libraries on Windows via MSYS2 using the
`install-sqlite-deps` input.

## v1.0.3

- Install PostgreSQL client libraries on Windows via Chocolatey.
Expand Down
30 changes: 29 additions & 1 deletion .github/actions/setup-rust/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Setup Rust

Install the Rust toolchain and cache your build dependencies. Optionally
install PostgreSQL system libraries for crates that require them.
install PostgreSQL and SQLite system libraries for crates that require
them.
Comment on lines 3 to +5
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Capitalise the start of the second sentence
The fragment
“Optionally
install PostgreSQL and SQLite system libraries for crates that require them.”
should begin with a capital “Install” for consistency and readability.

🤖 Prompt for AI Agents
In .github/actions/setup-rust/README.md around lines 3 to 5, the second sentence
starts with a lowercase "install" which breaks consistency and readability.
Change the first letter of "install" to uppercase "Install" to properly
capitalize the start of the sentence.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install does not start the sentence here, and so does not need a capital.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leynos You're absolutely right, and I apologize for the error. In the sentence "Optionally install PostgreSQL and SQLite system libraries for crates that require them," the word "Optionally" starts the sentence, not "install." The word "install" is the main verb but comes after the adverb. Thank you for the correction!


✏️ Learnings added
Learnt from: leynos
PR: leynos/shared-actions#8
File: .github/actions/setup-rust/README.md:3-5
Timestamp: 2025-06-21T00:58:38.608Z
Learning: When analyzing sentence structure for capitalization, pay careful attention to what word actually starts the sentence. Adverbs like "Optionally" can precede the main verb, making the adverb the first word that should be capitalized, not the verb that follows.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


## Inputs

| Name | Description | Required | Default |
| --- | --- | --- | --- |
| install-postgres-deps | Install PostgreSQL system dependencies | no | `false` |
| install-sqlite-deps | Install SQLite development libraries (Windows) | no | `false` |
| BUILD_PROFILE | Build profile used for caching | no | `release` |

## Outputs
Expand All @@ -20,6 +22,7 @@ None
uses: ./.github/actions/setup-rust@v1
with:
install-postgres-deps: true
install-sqlite-deps: true
```

When `install-postgres-deps` is enabled, the action installs PostgreSQL
Expand All @@ -28,6 +31,31 @@ it uses `apt` (`libpq-dev`). On Windows, Chocolatey installs
`postgresql17` and exposes its headers and import libraries through
`PG_INCLUDE` and `PG_LIB` environment variables.

When `install-sqlite-deps` is enabled, the action installs SQLite
development files using MSYS2 on Windows.

SQLite support on Windows is enabled by setting up an MSYS2 environment
with the MinGW toolchain and the `mingw-w64-x86_64-sqlite3` package,
so the static library and headers are available when compiling crates that
depend on SQLite.

```yaml
# Bring in MSYS2 plus the MinGW build of SQLite
- name: Install MSYS2 toolchain and SQLite
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-sqlite3 # ships libsqlite3.a + headers

# Build inside the MSYS2 shell so the linker sees /mingw64/lib
- name: Build
shell: msys2 {0}
run: cargo build --workspace --all-targets --verbose
```

## Caching

This action caches `~/.cargo/registry`, `~/.cargo/git` and the build output in
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: Install PostgreSQL system dependencies
required: false
default: false
install-sqlite-deps:
description: Install SQLite development libraries on Windows
required: false
default: false
runs:
using: composite
steps:
Expand Down Expand Up @@ -39,3 +43,13 @@ runs:
"PG_INCLUDE=$pgRoot\include" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
"PG_LIB=$pgRoot\lib" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "$pgRoot\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append

- name: Install MSYS2 toolchain and SQLite
if: ${{ inputs.install-sqlite-deps == 'true' && runner.os == 'Windows' }}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-sqlite3