-
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start fixing up tests * fix up tests + automate with drone * fiddle with linting * messing about with drone.yml * some more fiddling * hmmm * add cache * add vendor directory * verbose * ci updates * update some little things * update sig
- Loading branch information
1 parent
329a5e8
commit 98263a7
Showing
2,677 changed files
with
1,090,869 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,55 @@ | ||
--- | ||
### Drone configuration file for GoToSocial. | ||
### Connects to https://drone.superseriousbusiness.org to perform testing, linting, and automatic builds/pushes to docker. | ||
### | ||
### For documentation on drone, see: https://docs.drone.io/ | ||
### For documentation on drone docker pipelines in particular: https://docs.drone.io/pipeline/docker/overview/ | ||
|
||
kind: pipeline | ||
type: docker | ||
name: dockerpublish | ||
name: default | ||
steps: | ||
- name: publish image | ||
image: plugins/docker | ||
settings: | ||
auto_tag: true | ||
username: | ||
from_secret: gts_docker_username | ||
password: | ||
from_secret: gts_docker_password | ||
repo: superseriousbusiness/gotosocial | ||
tags: latest | ||
when: | ||
event: | ||
exclude: | ||
- pull_request | ||
|
||
# We use golangci-lint for linting. | ||
# See: https://golangci-lint.run/ | ||
- name: lint | ||
image: golangci/golangci-lint:v1.41.1 | ||
commands: | ||
- golangci-lint run --timeout 5m0s --tests=false --verbose | ||
|
||
- name: test | ||
image: golang:1.16.4 | ||
environment: | ||
GTS_DB_ADDRESS: postgres | ||
commands: | ||
# `-count 1` => run all tests at least once | ||
# `-p 1` => run maximum one test at a time | ||
# `./...` => run all tests | ||
- go test -count 1 -p 1 ./... | ||
|
||
- name: publish | ||
image: plugins/docker | ||
settings: | ||
auto_tag: true | ||
username: gotosocial | ||
password: | ||
from_secret: gts_docker_password | ||
repo: superseriousbusiness/gotosocial | ||
tags: latest | ||
when: | ||
event: | ||
exclude: | ||
- pull_request | ||
|
||
services: | ||
# We need this postgres service running for the test step. | ||
# See: https://docs.drone.io/pipeline/docker/syntax/services/ | ||
- name: postgres | ||
image: postgres | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
--- | ||
kind: signature | ||
hmac: 78dd20d97444a9e2904552d56eb52f43ad30ba27e1d897a5ea6808971f9a0ae2 | ||
|
||
... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,7 @@ Check the [issues](https://github.com/superseriousbusiness/gotosocial/issues) to | |
|
||
## Communications | ||
|
||
Before starting on something, please comment on an issue to say that you're working on it, and send a message to `@[email protected]` (Mastodon) to let them know. | ||
|
||
You can also drop into the GoToSocial Matrix room [here](https://matrix.to/#/!mdShFtfScQvVSmjIKX:ondergrond.org?via=ondergrond.org). | ||
Before starting on something, please comment on an issue to say that you're working on it, and/or drop into the GoToSocial Matrix room [here](https://matrix.to/#/#gotosocial:superseriousbusiness.org). | ||
|
||
This is the recommended way of keeping in touch with other developers, asking direct questions about code, and letting everyone know what you're up to. | ||
|
||
|
@@ -36,6 +34,38 @@ If there are no errors, great, you're good to go! | |
|
||
To work with the stylesheet for templates, you need [Node.js](https://nodejs.org/en/download/), then run `yarn install` in `web/source/`. Recompiling the bundle.css is `node build.js` but can be automated with [nodemon](https://www.npmjs.com/package/nodemon) on file change: `nodemon -w style.css build.js`. | ||
|
||
### Golang forking quirks | ||
|
||
One of the quirks of Golang is that it relies on the source management path being the same as the one used within `go.mod` and in package imports within individual Go files. This makes working with forks a bit awkward. | ||
|
||
Let's say you fork GoToSocial to `github.com/yourgithubname/gotosocial`, and then clone that repository to `~/go/src/github.com/yourgithubname/gotosocial`. You will probably run into errors trying to run tests or build, so you might change your `go.mod` file so that the module is called `github.com/yourgithubname/gotosocial` instead of `github.com/superseriousbusiness/gotosocial`. But then this breaks all the imports within the project. Nightmare! So now you have to go through the source files and painstakingly replace `github.com/superseriousbusiness/gotosocial` with `github.com/yourgithubname/gotosocial`. This works OK, but when you decide to make a pull request against the original repo, all the changed paths are included! Argh! | ||
|
||
The correct solution to this is to fork, then clone the upstream repository, then set `origin` of the upstream repository to that of your fork. | ||
|
||
See [this blogpost](https://blog.sgmansfield.com/2016/06/working-with-forks-in-go/) for more details. | ||
|
||
In case this post disappears, here are the steps (slightly modified): | ||
|
||
> | ||
> Pull the original package from the canonical place with the standard go get command: | ||
> | ||
> `go get github.com/superseriousbusiness/gotosocial` | ||
> | ||
> Fork the repository on Github or set up whatever other remote git repo you will be using. In this case, I would go to Github and fork the repository. | ||
> | ||
> Navigate to the top level of the repository on your computer. Note that this might not be the specific package you’re using: | ||
> | ||
> `cd $GOPATH/src/github.com/superseriousbusiness/gotosocial` | ||
> | ||
> Rename the current origin remote to upstream: | ||
> | ||
> `git remote rename origin upstream` | ||
> | ||
> Add your fork as origin: | ||
> | ||
> `git remote add origin [email protected]/yourgithubname/gotosocial` | ||
> | ||
## Setting up your test environment | ||
|
||
GoToSocial provides a [testrig](https://github.com/superseriousbusiness/gotosocial/tree/main/testrig) with a bunch of mock packages you can use in integration tests. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,10 @@ Proper documentation for running and maintaining GoToSocial will be forthcoming | |
|
||
For now (if you want to run it pre-alpha, like a beast), check out the [quick and dirty getting started guide](https://docs.gotosocial.org/en/latest/installation_guide/quick_and_dirty/). | ||
|
||
## Contributing | ||
|
||
You wanna contribute to GtS? Great! ❤️❤️❤️ Check out the issues page to see if there's anything you wanna jump in on, and read the [CONTRIBUTING.md](./CONTRIBUTING.md) file for guidelines and setting up your dev environment. | ||
|
||
## Contact | ||
|
||
For questions and comments, you can [join our Matrix channel](https://matrix.to/#/#gotosocial:superseriousbusiness.org) at `#gotosocial:superseriousbusiness.org`. This is the quickest way to reach the devs. You can also mail [[email protected]](mailto:[email protected]). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.