Compare commits
1
Commits
main
...
a4abc3806c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4abc3806c
|
@@ -13,7 +13,8 @@ jobs:
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
with:
|
||||
node-version: '24'
|
||||
- run: npm install
|
||||
- uses: pnpm/action-setup@v4
|
||||
- run: pnpm install --frozen-lockfile
|
||||
shell: bash
|
||||
- run: npm test
|
||||
- run: pnpm test
|
||||
shell: bash
|
||||
|
||||
@@ -18,7 +18,7 @@ This project uses [Vitest](https://vitest.dev/) for testing. The tests are locat
|
||||
To run the tests locally, use the following command:
|
||||
|
||||
```bash
|
||||
npm test
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Testing Pipeline
|
||||
@@ -28,6 +28,6 @@ The tests are automatically run on every push and workflow dispatch using a Gite
|
||||
The Gitea workflow does the following:
|
||||
|
||||
1. Checks out the code.
|
||||
2. Sets up Node.js.
|
||||
3. Installs the dependencies using `npm install`.
|
||||
4. Runs the tests using `npm test`.
|
||||
2. Sets up Node.js and pnpm.
|
||||
3. Installs the dependencies using `pnpm install`.
|
||||
4. Runs the tests using `pnpm test`.
|
||||
|
||||
@@ -84,7 +84,7 @@ This project includes a build step to prepare the action for use.
|
||||
### Why a Build Step?
|
||||
|
||||
We use a build step to compile the JavaScript code and its dependencies into a single, self-contained file (`dist/index.js`). This approach is chosen for the following reasons:
|
||||
1. **Zero-configuration at Runtime:** By bundling everything, the action runner doesn't need to run `npm install`, which speeds up the action execution.
|
||||
1. **Zero-configuration at Runtime:** By bundling everything, the action runner doesn't need to run `pnpm install` or `npm install`, which speeds up the action execution.
|
||||
2. **Reliability:** It guarantees that the exact versions of dependencies tested during development are used in the action, avoiding potential issues with version updates or missing packages.
|
||||
3. **Standard Practice:** This is a recommended practice for JavaScript-based GitHub/Gitea Actions.
|
||||
|
||||
@@ -100,8 +100,8 @@ We chose [`@vercel/ncc`](https://github.com/vercel/ncc) as the compiler because:
|
||||
If you modify `index.js` or change dependencies, you must rebuild the project before committing:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run build
|
||||
pnpm install
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
This will update the `dist/index.js` file, which should be committed to the repository.
|
||||
|
||||
Vendored
+8
-8
File diff suppressed because one or more lines are too long
Generated
-2326
File diff suppressed because it is too large
Load Diff
Generated
+1399
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
allowBuilds:
|
||||
bufferutil: true
|
||||
utf-8-validate: true
|
||||
+3
-3
@@ -8,12 +8,12 @@
|
||||
"packageRules": [
|
||||
{
|
||||
"matchManagers": [
|
||||
"npm"
|
||||
"pnpm"
|
||||
],
|
||||
"postUpgradeTasks": {
|
||||
"commands": [
|
||||
"npm ci",
|
||||
"npm run build"
|
||||
"pnpm install --frozen-lockfile",
|
||||
"pnpm run build"
|
||||
],
|
||||
"fileFilters": [
|
||||
"dist/index.js"
|
||||
|
||||
Reference in New Issue
Block a user