aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* GitHub Actions cleanups (#24620)silverwind2023-05-111-2/+2
| | | | | | | | | | - 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>
* Makefile: Use portable !, not GNUish -not, with find(1). (#24565)riastradh2023-05-071-1/+1
| | | | | fix https://github.com/go-gitea/gitea/issues/24564 Co-authored-by: Taylor R Campbell <campbell+gitea@mumble.net>
* Unify nightly naming across binaries and docker images (#24116)techknowlogick2023-04-241-0/+5
| | | | | | | | Proposal found here: https://github.com/go-gitea/gitea/issues/23654 TODO: make non-breaking (can we publish docker image using dev and nightly prefix? at same time). if anyone has advice please comment :) If this PR is merged, then I can add redirects to the downloads site.
* Replace whitespace inside template parens during make fmt (#24293)silverwind2023-04-241-2/+6
| | | | Remove space/tab after `(` and before `)` in templates. Only two violations it seems.
* Update go tool dependencies, restructure lint targets (#24239)silverwind2023-04-221-39/+71
| | | | | | | | - Update all tool dependencies to latest tag - Remove unused errcheck, it is part of golangci-lint - Include main.go in air - Enable wastedassign again now that it's [generics-compatible](https://github.com/golangci/golangci-lint/pull/3689) - Restructured lint targets to new `lint-*` namespace
* Make HAS_GO a simply expanded variable (#24169)silverwind2023-04-171-2/+2
| | | | Avoid recursive expansion on this variable and simplify the value. [Reference](https://www.gnu.org/software/make/manual/html_node/Setting.html).
* Introduce lint-md and compliance-docs pipeline (#24021)silverwind2023-04-091-1/+5
| | | | | | | - Add new Make target `lint-md` - Add new Drone pipeline `compliance-docs` - Add `*.md` to docs exclusion/inclusion - Consistently quote `path.include` and `path.exclude` statements in YAML
* Remove -v from vulncheck (#23953)John Olheiser2023-04-061-1/+1
| | | | We should think about locking this dep, but for now this should get builds going again.
* Clean some legacy files and move some build files (#23699)wxiaoguang2023-03-251-7/+2
| | | | | | | | | | | | | | | | | | | * Clean the "tools" directory. The "tools" directory contains only two files, move them. * The "external_renderer.go" works like "cat" command to echo Stdin to Stdout , to help testing. * The `// gobuild: external_renderer` is incorrect, there should be no space: `//gobuild: external_renderer` * The `fmt.Print(os.Args[1])` is not a well-defined behavior, and it's never used. * The "watch.sh" is for "make watch", it's somewhat related to "build" * After this PR, there is no "tools" directory, the project root directory looks slightly simpler than before. * Remove the legacy "contrib/autoboot.sh", there is no "gogs_supervisord.sh" * Remove the legacy "contrib/mysql.sql", it's never mentioned anywhere. * Remove the legacy "contrib/pr/checkout.go", it has been broken for long time, and it introduces unnecessary dependencies of the main code base.
* ensure go/bin path exists when copying hugo bin into it (#23692)techknowlogick2023-03-241-1/+1
| | | | | | follow up of https://github.com/go-gitea/gitea/pull/23686 path does not exist during static pipeline, and fails out (example: https://drone.gitea.io/go-gitea/gitea/70587/1/5 )
* Add `deps-docs` command to makefile (#23686)Yarden Shoham2023-03-241-4/+8
| | | | | | Refactored `deps-docs` out of `docs` because #23629 broke Gitpod's docs setup (which grepped to get the hugo install command). Now `make deps` really installs everything to develop (includes `docs`).
* Restructure documentation. Now the documentation has installation, ↵Lunny Xiao2023-03-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | administration, usage, development, contributing the 5 main parts (#23629) - **Installation**: includes how to install Gitea and related other tools, also includes upgrade Gitea - **Administration**: includes how to configure Gitea, customize Gitea and manage Gitea instance out of Gitea admin UI - **Usage**: includes how to use Gitea's functionalities. A sub documentation is about packages, in future we could also include CI/CD and others. - **Development**: includes how to integrate with Gitea's API, how to develop new features within Gitea - **Contributing**: includes how to contribute code to Gitea repositories. After this is merged, I think we can have a sub-documentation of `Usage` part named `Actions` to describe how to use Gitea actions --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Enable color for consistency checks diffs (#23563)silverwind2023-03-181-5/+5
| | | | | | Drone can display terminal colors, so force-enable it to make diffs more readable on it. Co-authored-by: delvh <leon@kske.dev>
* Replace Less with CSS (#23481)silverwind2023-03-141-3/+3
| | | | | | | | | | | | Ran most of the Less files through the Less compiler and Prettier and then followed up with a round of manual fixes. The Less compiler had unfortunately stripped all `//` style comments that I had to restore (It did preserve `/* */` comments). Other fixes include duplicate selector removal which were revealed after the transpilation and which weren't caught by stylelint before but now are. Fixes: https://github.com/go-gitea/gitea/issues/15565
* test_env: hardcode major go version in use (#23464)techknowlogick2023-03-141-1/+1
| | | | | | | | hardcode the version of test_env we use in docker, so that we can use different major versions of golang between versions of Gitea --------- Co-authored-by: Lauris BH <lauris@nix.lv>
* Split CI pipelines (#23385)John Olheiser2023-03-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This PR attempts to split our various DB tests into separate pipelines. - It splits up some of the extra feature-related tests rather than having most of them in the MySQL test. - It disables the race detector for some of the pipelines as well, as it can cause slower runs and is mostly redundant when the pipelines just swap DBs. - It builds without SQLite support for any of the non-SQLite pipelines. - It moves the e2e test to using SQLite rather than PG (partially because I moved the minio tests to PG and that mucked up the test config, and partially because it avoids another running service) - It splits up the `go mod download` task in the Makefile from the tool installation, as the tools are only needed in the compliance pipeline. (Arguably even some of the tools aren't needed there, but that could be a follow-up PR) - SQLite is now the only arm64 pipeline, moving PG back to amd64 which can leverage autoscaler Should resolve #22010 - one thing that wasn't changed here but is mentioned in that issue, unit tests are needed in the same pipeline as an integration test in order to form a complete coverage report (at least as far as I could tell), so for now it remains in a pipeline with a DB integration test. Please let me know if I've inadvertently changed something that was how it was on purpose. --- I will say sometimes it's hard to pin down the average time, as a pipeline could be waiting for a runner for X minutes and that brings the total up by X minutes as well, but overall this does seem to be faster on average. --------- Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix Fomantic UI's `touchstart` fastclick, always use `click` for click ↵wxiaoguang2023-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | events (#23065) Using `touchstart` for `click` events is a black magic for mobile browsers (Google: `fastclick`). However, it causes many UX problems if the fastclick is used without careful design. Fomantic UI uses this fastclick for its `dimmer` and `dropdown`, it makes mobile users feel strange when they "touch" the dropdown menu. This PR uses a simple patch to fix that behavior. Then the Fomantic dropdown only uses `click` for click events. This PR is simple enough and won't cause hidden bugs even if the patch doesn't work. In the future, if there are more patches for Fomantic UI, the patches could be placed in a directory like `web_src/fomantic/patches/001-fix-click-touchstart`, etc. ![image](https://user-images.githubusercontent.com/2114189/220551915-bd28e8cc-507f-43c7-bb4a-b24f7ff3934d.png) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update go.mod dependencies (#23126)zeripath2023-02-241-1/+1
| | | | | | | | | | | | | | This PR does a bulk update of a lot of our go deps. I have not included nektos/act and xorm for the following reasons: * Xorm updates can sometimes be complex and I'd rather do that in a separate PR * I think people more update with the actions code should double check that the latest nektos/act library works correctly. --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* update to build with go1.20 (#22732)techknowlogick2023-02-031-2/+2
| | | | | | | as title --------- Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove the netgo tag for Windows build (#22467)wxiaoguang2023-01-161-2/+2
| | | | | | | | | | | | | Fix #22370 and more. Before Go 1.19, the `netgo` tag for Windows does nothing. But Go 1.19 rewrite the net package code for Windows DNS, and there is a bug: * https://github.com/golang/go/issues/57757 This PR just removes the `netgo` tag for Windows build, then the Gitea for Windows can have the old DNS behavior.
* cgo cross-compile for freebsd (#22397)techknowlogick2023-01-101-1/+8
| | | | | Provide pre-compiled cgo binaries for freebsd Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Add more test directory to exclude dir of air, remove watching templates ↵Lunny Xiao2022-12-271-1/+1
| | | | | | | | | | | | | | from air include dir because gitea has internal mechanism (#22246) Since #20218 introduced internal watching template, template watching should be removed from `air`. This will prevent restart the whole server once the template files changed to speed up developing when using `make watch`. To ensure `make watch` will reuse template watching, this PR introduced a new ENV `GITEA_RUN_MODE` to make sure `make watch` will always run in a dev mode of Gitea so that template watching will open. This PR also added more exclude testdata directories.
* Update go dev dependencies (#22064)silverwind2022-12-081-6/+6
| | | | | `golangci-lint` [deprecated](https://github.com/golangci/golangci-lint/issues/1841) a bunch of linters, removed them.
* Consolidate security-check into checks-backend (#21882)silverwind2022-11-211-2/+2
| | | Also, run it via exact version instead of relying on global binary.
* Split migrations folder (#21549)Lunny Xiao2022-11-021-38/+56
| | | | There are too many files in `models/migrations` folder so that I split them into sub folders.
* Remove unnecessary misspell ignore pattern (#21475)wxiaoguang2022-10-181-1/+1
| | | It doesn't make sense to ignore the pattern again and again.
* Simplify fmt-check (#21458)silverwind2022-10-161-18/+16
| | | | | | | | | `fmt-check` now simply does `fmt` before and relies on `git diff` like other checks like 'tidy-check' already do, so we can remove the argument in the tool that handles printing changed files. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Switch from jest to vitest (#21444)silverwind2022-10-141-1/+1
| | | | | | | | | | | | | | Even if we are not bundling with `vite` yet, we can use `vitest` in place of Jest which brings a few benefits like not requiring to use `NODE_OPTIONS` to run and having sane module resolution. It's possible to also use `jest-extended` with vitest, but I opted to not do so for now because it brings heavyweight dependencies and it was trivial to just rewrite the affected matchers to be compatible. This PR also removes 153 JS dependencies, which is certainly nice. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Hook go-licenses into tidy again (#21353)silverwind2022-10-101-6/+4
| | | | | | | | | Running it as part of the build is really unnecessary because we have a valid output file in the repo and assuming go dependencies do not change unless go.mod also changes, tidy really is the best target to run the license generation after. Also, regenerate the file as I missed to do so during the chroma update, and mark all json files in assets as generated.
* Update JS dependencies and eslint config (#21388)silverwind2022-10-101-1/+1
| | | | | | | | - Update all JS dependencies and playwright image - Add new eslint rules, enable a few more, fix issues - Regenerate SVGs - Tested Vue and Swagger Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* chore(security): Support Go Vulnerability Management (#21139)Bo-Yi Wu2022-09-111-0/+6
| | | | | | | See https://go.dev/security/vuln/ Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com> Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
* Generate go-licenses during tidy again (#21108)silverwind2022-09-091-8/+9
| | | | | | | | | | | | | | We can not have the `frontend` target depend on golang because of they way drone is set up. Move the `go-licenses` generation back into `tidy` where it will now also be checked for consistency during `tidy-check`. (I assume all `main` branch builds should currently fail [like this](https://drone.gitea.io/go-gitea/gitea/60244/1/11)). The reasony why it shouldn't be treated the same as for example `go generate` is because output files are checked in. tidy is imho the optimal target to run this after. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Rewrite go license generator in go (#21078)silverwind2022-09-071-4/+4
| | | | | | | | | | This removes the JS dependency in the checks pipeline. JSON output is different because the previous JS did indent the license data differently and a JSON key was changed, but the end result is the same as it gets re-indented by wepack. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Move go-licenses to generate and separate generate into a frontend and ↵zeripath2022-09-051-6/+21
| | | | | | | | | | | | | | | | | | | | | | backend component (#21061) The `go-licenses` make task introduced in #21034 is being run on make vendor and occasionally causes an empty go-licenses file if the vendors need to change. This should be moved to the generate task as it is a generated file. Now because of this change we also need to split generation into two separate steps: 1. `generate-backend` 2. `generate-frontend` In the future it would probably be useful to make `generate-swagger` part of `generate-frontend` but it's not tolerated with our .drone.yml Ref #21034 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
* Add go licenses to licenses.txt (#21034)silverwind2022-09-041-2/+17
| | | | | | | `make go-licenses` will generate `assets/go-licenses.json` which is then included in the webpack build. This step depends on both go and node being present, so unfortunately, I could not automate the generation by hooking it up to `tidy` as that target is triggered on CI where we do not have a docker image with both go an node. It should be ran from time to time, ideally after each go mod update.
* Kd/ci playwright go test (#20123)Kyle D2022-09-021-50/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add initial playwright config * Simplify Makefile * Simplify Makefile * Use correct config files * Update playwright settings * Fix package-lock file * Don't use test logger for e2e tests * fix frontend lint * Allow passing TEST_LOGGER variable * Init postgres database * use standard gitea env variables * Update playwright * update drone * Move empty env var to commands * Cleanup * Move integrations to subfolder * tests integrations to tests integraton * Run e2e tests with go test * Fix linting * install CI deps * Add files to ESlint * Fix drone typo * Don't log to console in CI * Use go test http server * Add build step before tests * Move shared init function to common package * fix drone * Clean up tests * Fix linting * Better mocking for page + version string * Cleanup test generation * Remove dependency on gitea binary * Fix linting * add initial support for running specific tests * Add ACCEPT_VISUAL variable * don't require git-lfs * Add initial documentation * Review feedback * Add logged in session test * Attempt fixing drone race * Cleanup and bump version * Bump deps * Review feedback * simplify installation * Fix ci * Update install docs
* Include go.mod in gomod-check and rename to tidy-check (#21025)silverwind2022-09-021-4/+4
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Make sure fmt catches all templates (#20979)silverwind2022-08-311-1/+1
| | | | | | | | * Make sure fmt catches all templates Make's `wildcard` is not recursive so it missed many template files, fix that by using `find`. * Update Makefile
* Go 1.19 format (#20758)John Olheiser2022-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 1.19 gofumpt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change CSV test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Commit whitespace fixes from @zeripath Co-authored-by: zeripath <art27@cantab.net> * Update emoji Signed-off-by: jolheiser <john.olheiser@gmail.com> * bump swagger & fix generate-swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add whitespace removal inside template curly brackes (#20853)silverwind2022-08-251-2/+10
|
* Remove debug output when coverage fails (#20733)silverwind2022-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | * Remove debug output when coverage fails When coverage fails, it logs megabytes of debug to stdout, which seems to break the drone ui as well as the log output download in drone, presumably because of the size. I think with removal of this print, we should still see any errors created by gocovmerge.go, but a few CI runs may be necessary to get it to fail again. * Update Makefile * restart ci * restart ci * restart ci * restart ci Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Switch to building with go1.19 (#20695)techknowlogick2022-08-071-1/+1
|
* Add markdownlint (#20512)silverwind2022-07-281-0/+1
| | | | Add `markdownlint` linter and fix issues. Config is based on the one from electron's repo with a few rules relaxed.
* Downgrade golangci-lint to 1.47.0 (#20445)silverwind2022-07-221-1/+1
| | | | | | | This should fix some recently seen linter performance issues. There is some log spam, but it's definitely faster. Ref: https://github.com/golangci/golangci-lint/issues/2997 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update all tool dependencies to their latest versions (#20409)silverwind2022-07-201-4/+4
|
* Fix eslint parsing errors, remove eslint-plugin-html (#20323)silverwind2022-07-151-1/+1
| | | | | | | | | | | Introduce a separate .eslintrc in the Vue components folder to selectively enable vue-eslint-parser there, so that the rest of the files can use eslint's core parser which can deal with hashbangs. The fact that the eslint-disable comments worked in HTML was a unintended side-effect of the files being parsed via vue-eslint-parser, so I had to disable the parsing of these files in .eslintrc.yaml to make it work, and finally decided to remove eslint-plugin-html as it causes more issues than it solves.
* Fix versions check for busybox `sh` (#20358)silverwind2022-07-141-3/+3
| | | | | | `printf` in busybox emits a ugly 'invalid number' error when formatting string variables are present. Avoid that by reducing the go version check to just two digits, which ought to be enough as patch-level go versions are meant to be compatible. Avoid error on node-check as well.
* Fix various typos (#20338)luzpaz2022-07-121-1/+1
| | | | | | | * Fix various typos Found via `codespell -q 3 -S ./options/locale,./options/license,./public/vendor -L actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon` Co-authored-by: zeripath <art27@cantab.net>
* Add spectral linter for Swagger (#20321)silverwind2022-07-111-0/+1
| | | | | | | | | | [spectral](https://github.com/stoplightio/spectral) lints openapi/swagger files for mistakes of which it has identified a few and which I've fixed. I had to put it into `lint-frontend` because it depends on node_modules so can not run on Drone during the backend target. I plan to refactor these targets later to `lint-js` and `lint-go` so that they are categorized based on the tool dependencies.
* Remove `GO111MODULE` (#20221)Gusted2022-07-041-4/+3
| | | | | - Given we use go1.18 for this and don't rely on the Go 1.11 modules behavior(we use the modern `go run` & `go get` which has the correct behavior by-default).