Compare commits
1
Commits
main
..
f9bb82a18b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9bb82a18b |
@@ -9,8 +9,8 @@ jobs:
|
||||
name: pre-commit Linting
|
||||
runs-on: pi
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||
- run: pip install pre-commit
|
||||
shell: bash
|
||||
- name: Pre Commit
|
||||
|
||||
@@ -9,12 +9,11 @@ jobs:
|
||||
name: Run Tests
|
||||
runs-on: pi
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version: '24'
|
||||
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: npm install
|
||||
shell: bash
|
||||
- run: pnpm test
|
||||
- run: npm test
|
||||
shell: bash
|
||||
|
||||
@@ -21,7 +21,6 @@ repos:
|
||||
hooks:
|
||||
- id: pretty-format-yaml
|
||||
args: [--autofix]
|
||||
exclude: ^pnpm-lock\.yaml$
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v4.0.0-alpha.8
|
||||
@@ -30,7 +29,7 @@ repos:
|
||||
types_or: [css, javascript]
|
||||
|
||||
- repo: https://github.com/python-jsonschema/check-jsonschema
|
||||
rev: 0.37.4
|
||||
rev: 0.37.2
|
||||
hooks:
|
||||
- id: check-renovate
|
||||
- id: check-github-actions
|
||||
|
||||
@@ -19,7 +19,7 @@ This project uses [Vitest](https://vitest.dev/) for testing. The tests are locat
|
||||
To run the tests locally, use the following command:
|
||||
|
||||
```bash
|
||||
pnpm test
|
||||
npm test
|
||||
```
|
||||
|
||||
### Testing Pipeline
|
||||
@@ -29,6 +29,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 and pnpm.
|
||||
3. Installs the dependencies using `pnpm install`.
|
||||
4. Runs the tests using `pnpm test`.
|
||||
2. Sets up Node.js.
|
||||
3. Installs the dependencies using `npm install`.
|
||||
4. Runs the tests using `npm 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 `pnpm install` or `npm install`, which speeds up the action execution.
|
||||
1. **Zero-configuration at Runtime:** By bundling everything, the action runner doesn't need to run `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
|
||||
pnpm install
|
||||
pnpm run build
|
||||
npm install
|
||||
npm 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
+3
-4
@@ -3,7 +3,6 @@
|
||||
"version": "0.2.1",
|
||||
"description": "Deploys screeps code to the official game or a private server.",
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@11.21.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
@@ -17,8 +16,8 @@
|
||||
"screeps-api": "^1.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "^0.44.1",
|
||||
"@vitest/coverage-v8": "^4.1.10",
|
||||
"vitest": "^4.1.10"
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"@vitest/coverage-v8": "^4.0.16",
|
||||
"vitest": "^4.0.16"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
-1408
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
allowBuilds:
|
||||
bufferutil: true
|
||||
utf-8-validate: true
|
||||
+3
-3
@@ -8,12 +8,12 @@
|
||||
"packageRules": [
|
||||
{
|
||||
"matchManagers": [
|
||||
"pnpm"
|
||||
"npm"
|
||||
],
|
||||
"postUpgradeTasks": {
|
||||
"commands": [
|
||||
"pnpm install --frozen-lockfile",
|
||||
"pnpm run build"
|
||||
"npm ci",
|
||||
"npm run build"
|
||||
],
|
||||
"fileFilters": [
|
||||
"dist/index.js"
|
||||
|
||||
Reference in New Issue
Block a user