Commit Graph

22 Commits

Author SHA1 Message Date
silverwind 2ab5f05f40
Add svg linter and fix incorrect svgs (#30086)
Fixes https://github.com/go-gitea/gitea/issues/30082.

Adds a new linter that searches for non-existant SVG images in
templates. Output before the fix was:

```
$ make lint-templates
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-markup" not found, used in templates/repo/diff/comment_form.tmpl
make: *** [Makefile:438: lint-templates] Error 1
```

<img width="306" alt="Screenshot 2024-03-25 at 23 31 05"
src="https://github.com/go-gitea/gitea/assets/115237/1052d1a9-bfec-4d5a-9cae-f895f78f7c93">
2024-03-26 11:19:15 +00:00
silverwind efa631aeea
Update js and py dependencies, bump python (#29561)
- Update js and py dependencies excluding `@mcaptcha/vanilla-glue`,
`eslint-plugin-array-func`
- Update stylelint config
- Require python 3.10 and use 3.12 on CI, bump setup-python as well
- Tested markdown toolbar, charts, clipboard, swagger ui, vue
2024-03-03 17:23:14 +01:00
silverwind 9c39f8515f
Rework spellchecking, add `lint-spell` (#29106)
- Use maintained fork https://github.com/golangci/misspell
- Rename `mispell-check` to `lint-spell`, add `lint-spell-fix`
- Run `lint-spell` in separate actions step
- Lint more files, fix discovered issues
- Remove inaccurate and outdated info in docs (we do not need GOPATH for
tools anymore)

Maybe later we can add more spellchecking tools, but I have not found
any good ones yet.
2024-02-09 03:59:39 +00:00
Rui Chen caceb43313
feat: bump `dessant/lock-threads` and `actions/setup-go` to use nodejs20 runtime (#28565)
Update more actions to use nodejs20 runtime and also update the docs for
checkout action usage.

similar to:
- #27836
- #27096

---------

Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-12-21 13:31:04 +08:00
Chongyi Zheng 0a710133cd
Bump workflows in github actions (#27836)
All major version upgrades are related to using Node v20 as default
runtime
2023-10-30 15:56:43 +08:00
Yevhen Pavlov d98c863884
actions/setup-go use go-version-file (#27651)
These changes will allow not to specify the version of go in every
pipeline.
2023-10-17 10:24:54 +00:00
puni9869 5e039b0580
Upgrading the actions/checkout@4 (#27096)
as title
..Upgrading the actions/checkout@4

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-09-16 15:06:27 +00:00
silverwind 3c0c279658
Add `yamllint` (#26965)
So that https://github.com/go-gitea/gitea/pull/26964 does not happen
again. Merge this after that PR. Config is based on
[node's](https://github.com/nodejs/node/blob/main/.yamllint.yaml).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-07 22:24:06 -04:00
silverwind 1772814605
Lock go to 1.21 on CI (#26433)
To prevent unwanted surprises with new minor versions of go, lock the
version to minor version using [semver tilde
syntax](https://github.com/npm/node-semver#tilde-ranges-123-12-1). We
were already getting 1.21.0 since yesterday, so use that version now as
minimum.
2023-08-10 21:53:44 +00:00
John Olheiser bd4c7ce578
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-26 04:53:13 +00:00
silverwind fdf71460f9
Fix `lint-swagger` action (#25593)
- Add detection for swagger changes and run `lint-swagger` on it
- Remove `lint-swagger` from `lint-frontend`
- Remove `lint-md` from `lint-frontend`
2023-06-29 10:37:41 -04:00
silverwind 478f33030e
Remove `deps-tools` from `backend` job (#25454) 2023-06-22 23:24:55 +00:00
silverwind 6281ebfec3
add `test-frontend` back to actions (#25452)
Apparently we were not running `test-frontend` on actions, this adds it
back.
2023-06-22 23:37:50 +02:00
silverwind e24f651c86
Add template linting via djlint (#25212)
So I found this [linter](https://github.com/Riverside-Healthcare/djlint)
which features a mode for go templates, so I gave it a try and it did
find a number of valid issue, like unbalanced tags etc. It also has a
number of bugs, I had to disable/workaround many issues.

Given that this linter is written in python, this does add a dependency
on `python` >= 3.8 and `poetry` to the development environment to be
able to run this linter locally.

- `e.g.` prefixes on placeholders are removed because the linter had a
false-positive on `placeholder="e.g. cn=Search"` for the `attr=value`
syntax and it's not ideal anyways to write `e.g.` into a placeholder
because a placeholder is meant to hold a sample value.
- In `templates/repo/settings/options.tmpl` I simplified the logic to
not conditionally create opening tags without closing tags because this
stuff confuses the linter (and possibly the reader as well).
2023-06-14 18:17:58 +00:00
silverwind 4c290e9209
GitHub Actions enhancements for frontend (#25150)
- Don't run DB tests for frontend-only changes
- Build frontend as part of frontend step
- Build everything when actions change
2023-06-14 23:30:37 +08:00
silverwind d783384c19
Clean up github actions (#24984)
- Merge the file filters into `files-changed.yml`
- Remove unused yaml anchors like `&backend`
- Merge the `compliance-docs` workflow into `compliance`
- Add actions linting
- Misc cleanups for whitespace and step names
2023-05-30 13:31:00 +08:00
Lunny Xiao 93c6a9a652
Use file filters action instead of Github's files filter (#24877)
Inspired by
https://github.com/go-gitea/gitea/pull/24530#issuecomment-1558815301

This PR use a file filter action to do different CI jobs according
changed files types. All types are defined in
`.github/file-filters.yml`. Now there are 4 types, `docs`, `backend`,
`frontend` and `build`. Then if a PR only changed docs files, those CI
jobs which passed the conditions will run, and other types are also like
this.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-05-25 01:33:31 +00:00
Lunny Xiao c78b923822
Don't run build and test if only docs changed (#24530)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-05-16 02:53:18 +00:00
silverwind 6c8b680f91
GitHub Actions cleanups (#24620)
- Remove actions name where command is descriptive enough
- Use kebab-case instead of snake-case for step names
- Use shorter job names because to make PR checks more readable
- Remove duplicate `checks-backend`

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
2023-05-11 21:21:28 -04:00
Lunny Xiao 0deb5053bd
Check latest version on CI (#24556) 2023-05-06 15:43:56 +08:00
silverwind 0ca1958e1a
Upgrade to Node 20 on CI, enable actions cancellation (#24524)
- Upgrade node, the
[snap](7abe958f5b/snap/snapcraft.yaml (L47))
is excluded from this because [there is no Node 20 snap
yet](https://snapcraft.io/node).
- Add actions build cancellation based on
[this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-05-04 22:21:48 +00:00
techknowlogick f7f0782132
Use Actions for DB & E2E tests (#24494)
following https://github.com/go-gitea/gitea/pull/24314 and
https://github.com/go-gitea/gitea/pull/24434, this PR moves drone cron
pipelines to (GitHub) Actions. As these are mostly compatible with Gitea
Actions, when we start to dogfood, these will already be migrated.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-05-04 02:04:02 +00:00