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
fix: Fixes lychee version and adds CICD support (#295)
* fix: Fixes lychee version and adds CICD support
- Fix pre-commit autoupdate reverting lychee to mutable 'nightly' ref
- Exclude lychee from Makefile and CI autoupdate (non-standard tags)
- Add .secrets support for ACT GitHub token authentication
- Update developer docs with pre-commit hooks and ACT setup guide
* fix: lychee execution in the GitHub Action has errors
Those errors are
```
## Errors per input
### Errors in docs/Bitvavo.md
* [403] <https://bitvavo.com/en/> | Rejected status code (this depends on your "accept" configuration): Forbidden
* [403] <https://bitvavo.com/en/markets> | Rejected status code (this depends on your "accept" configuration): Forbidden
* [403] <https://support.bitvavo.com/hc/en-us> | Rejected status code (this depends on your "accept" configuration): Forbidden
### Errors in docs/DEGIRO.md
* [503] <https://www.degiro.com/> | Rejected status code (this depends on your "accept" configuration): Service Unavailable
* [503] <https://www.degiro.nl/helpdesk/> | Rejected status code (this depends on your "accept" configuration): Service Unavailable
```
But those work locally. The issue may be due to rate limiting or network restrictions.
We will ignore it so far and look into detail in the future.
Copy file name to clipboardExpand all lines: docs/Developing-Stonks-Overwatch.md
+113-1Lines changed: 113 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,39 @@ These commands will check the code linting or do the best effort to properly for
142
142
Make sure to execute `make pre-commit-install` to install the pre-commit hooks, so the code is automatically checked
143
143
before committing.
144
144
145
+
#### Pre-commit Hooks
146
+
147
+
The project uses pre-commit hooks to maintain code quality. The hooks include:
148
+
149
+
- Code formatting (Ruff)
150
+
- Python linting (Ruff)
151
+
- YAML validation
152
+
- Markdown linting
153
+
- Link checking (Lychee)
154
+
- Poetry validation
155
+
- Django system checks
156
+
- Test execution
157
+
158
+
**Installing hooks:**
159
+
160
+
```shell
161
+
make pre-commit-install
162
+
```
163
+
164
+
**Running hooks manually:**
165
+
166
+
```shell
167
+
make pre-commit-run
168
+
```
169
+
170
+
**Updating hook versions:**
171
+
172
+
```shell
173
+
make pre-commit-update
174
+
```
175
+
176
+
> **Note on Lychee**: The link checker (Lychee) uses a non-standard tag format (`lychee-vX.Y.Z`) which is excluded from automatic updates. The `make pre-commit-update` command only updates the `pre-commit-hooks` and `ruff-pre-commit` repositories to prevent reverting Lychee to a mutable `nightly` branch reference. If you need to update Lychee, manually edit `.pre-commit-config.yaml` and change the `rev` to the desired stable tag (e.g., `lychee-v0.22.0`).
177
+
145
178
### Test
146
179
147
180
```shell
@@ -202,7 +235,86 @@ As before, only the application for the current OS will be created and executed.
202
235
make cicd
203
236
```
204
237
205
-
Will execute the GitHub Actions locally. It's a good way of validating changes in the CI/CD code
238
+
Will execute the GitHub Actions locally using [ACT](https://github.com/nektos/act). It's a good way of validating changes in the CI/CD code before pushing to GitHub.
239
+
240
+
#### Setting up ACT for Local CI/CD Testing
241
+
242
+
ACT requires a GitHub Personal Access Token to clone GitHub Actions (like `actions/setup-python`, `actions/cache`, etc.).
243
+
244
+
**Initial Setup:**
245
+
246
+
1. **Create a GitHub Personal Access Token:**
247
+
- Go to: [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new)
248
+
- Token name: "ACT Local Testing"
249
+
- Expiration: Your choice (90 days recommended)
250
+
- Select scopes: Check **"public_repo"** (for public repositories)
Replace `ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` with your actual token.
267
+
268
+
4. **Test it:**
269
+
270
+
```shell
271
+
make cicd job=lint
272
+
```
273
+
274
+
>**Security Note**: The `.secrets` file is already in`.gitignore` and will never be committed to the repository.
275
+
276
+
**Running Specific Jobs:**
277
+
278
+
```shell
279
+
# Run the lint job
280
+
make cicd job=lint
281
+
282
+
# Run the test job
283
+
make cicd job=test
284
+
285
+
# List all available jobs
286
+
make cicd
287
+
```
288
+
289
+
**Running Specific Workflows:**
290
+
291
+
```shell
292
+
# Run the entire CI/CD workflow
293
+
make cicd workflow=cicd
294
+
295
+
# Run the pre-commit autoupdate workflow
296
+
make cicd workflow=precommit-autoupdate
297
+
```
298
+
299
+
**Troubleshooting ACT:**
300
+
301
+
If you see authentication errors like `authentication required: Invalid username or token`, ensure:
302
+
- Your `.secrets` file exists and contains a valid `GITHUB_TOKEN`
303
+
- The token has the `public_repo` scope enabled
304
+
- You've copied the token correctly (no extra spaces or newlines)
305
+
306
+
**Note on Lychee Link Checking:**
307
+
The link checking step (lychee) is automatically skipped when running with ACT due to architecture compatibility issues (ARM64 vs x86_64). The lychee check will still run in the actual GitHub Actions environment. You can verify links locally by running:
0 commit comments