You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-18Lines changed: 48 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,11 @@ Initiate a dry run of a patch release of this library via GitHub Actions. This p
76
76
77
77
#### `npm test`
78
78
79
-
Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/).
79
+
Formats and lints Rust and TypeScript code.
80
+
Also runs Rust tests.
81
+
82
+
Note: `npm test` at project root does not run integration tests.
83
+
For integration tests, see [below](#integration-tests).
80
84
81
85
## Project Layout
82
86
@@ -86,6 +90,7 @@ The directory structure of this project is:
|`Cargo.toml`| The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. |
110
+
|`README.md`| This file. |
111
+
|`integration-tests/`| The directory containing integration tests. |
112
+
|`lib/`| The directory containing the generated output from [tsc](https://typescriptlang.org). |
113
+
|`src/`| The directory containing the TypeScript source files. |
114
+
|`index.mts`| Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. |
115
+
|`index.cts`| Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). |
116
+
|`crates/`| The directory tree containing the Rust source code for the project. |
117
+
|`lib.rs`| Entry point for the Rust source code. |
118
+
|`platforms/`| The directory containing distributions of the binary addon backend for each platform supported by this library. |
119
+
|`package.json`| The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. |
120
+
|`target/`| Binary artifacts generated by the Rust build. |
121
+
122
+
## Integration tests
123
+
124
+
Integration tests live in the `./integration-tests` directory.
125
+
These tests use the local build of Rust and JavaScript artifacts to test `@cipherstash/protect-ffi` as API consumers would.
126
+
127
+
These tests rely on CipherStash to be configured (via `.toml` config or environment variables).
128
+
129
+
Example environment variables to set:
130
+
```
131
+
CS_CLIENT_ID=
132
+
CS_CLIENT_KEY=
133
+
CS_CLIENT_ACCESS_KEY=
134
+
CS_WORKSPACE_ID=
135
+
```
136
+
137
+
To run integration tests:
138
+
```
139
+
npm run debug
140
+
cd integration-tests
141
+
npm run test
142
+
```
115
143
116
144
## Releasing
117
145
118
146
Releases are handled by GitHub Actions using a `workflow_dispatch` event trigger.
119
147
The [release workflow](./.github/workflows/release.yml) was generated by [Neon](https://neon-rs.dev/).
120
148
121
149
The release workflow is responsible for:
150
+
122
151
- Building and publishing the main `@cipherstash/protect-ffi` package as well as the native packages for each platform (e.g. `@cipherstash/protect-ffi-darwin-arm64`).
123
152
- Creating the GitHub release.
124
153
- Creating a Git tag for the version.
125
154
126
155
To perform a release:
156
+
127
157
1. Navigate to the ["Release" workflow page](https://github.com/cipherstash/protect-ffi/actions/workflows/release.yml) in GitHub.
128
158
1. Click on "Run workflow".
129
159
1. Select the branch to release from.
130
-
Use the default of "main" unless you want to do a pre-release version or dry run from a branch.
160
+
Use the default of `main` unless you want to do a pre-release version or dry run from a branch.
131
161
1. Select whether or not to do a dry run.
132
-
Dry runs are useful for verifying that the build will succeed for all platforms before doing a full run with a publish.
162
+
Dry runs are useful for verifying that the build will succeed for all platforms before doing a full run with a publish.
133
163
1. Choose a version to publish.
134
-
The options are similar to [`npm version`](https://docs.npmjs.com/cli/v11/commands/npm-version).
135
-
Select "custom" in the dropdown and fill in the "Custom version" text box if you want to use a semver string instead of the shorthand (patch, minor, major, etc.).
164
+
The options are similar to [`npm version`](https://docs.npmjs.com/cli/v11/commands/npm-version).
165
+
Select "custom" in the dropdown and fill in the "Custom version" text box if you want to use a semver string instead of the shorthand (patch, minor, major, etc.).
136
166
1. Click "Run workflow".
137
167
138
168
Note that we currently don't have any automation around release notes or a changelog.
0 commit comments