1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-27 01:33:39 +02:00
goreleaser/dagger
Kyle Penfound d594cdd436
ci: daggerize test pipeline (#4969)
## What is this?

This daggerizes the lint, test, and build pipelines for Goreleaser.

## Why?

For context, the previous pass at this can be found here
https://github.com/goreleaser/goreleaser/pull/4186 . Since that time,
the DX for using Dagger has been considerably improved.

The benefit this brings to the Goreleaser project is that the test
pipeline can be run locally the same as it is run in CI without
requiring contributors to configure additional tools in their developer
environments. Additionally, by codifying the test and build execution
environments, you no longer need to be concerned with changing or
outdated Github Actions runner environments.


## How?

As a contributor, you can simply clone/fork Goreleaser and run:


`dagger functions` to see which commands are available.

To lint local code:

`dagger call --source . lint`

To run tests against local code:

`dagger call --source . test output`

To run tests against local code and get the coverage report:

`dagger call --source . test coverage-report -o ./coverage.txt`

To run tests on the main branch on Github:

`dagger call --source=https://github.com/goreleaser/goreleaser test
output`

To run tests against a PR branch on Github:

`dagger call
--source=https://github.com/goreleaser/goreleaser#pull/4958/head test
output`

To run tests against a PR branch using the dagger pipeline committed to
the main branch, without checking out goreleaser:

`dagger -m github.com/goreleaser/goreleaser call
--source=https://github.com/goreleaser/goreleaser#pull/4958/head test
output`

And so on 😃 

## Also

In addition to the Dagger code, I've updated the build.yml workflow to
use the test pipeline and updated CONTRIBUTING.md with the command to
run tests with Dagger.
Note that I did not update the Taskfile.yml to avoid breaking anything
for contributors comfortable with their existing workflows.

Do you feel that this will benefit the Goreleaser project? Would you
like to see the Dagger functions doing more/less?

---------

Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: Lev Lazinskiy <lev@levlaz.org>
Signed-off-by: Lev Lazinskiy <lev@dagger.io>
Co-authored-by: Lev Lazinskiy <lev@levlaz.org>
Co-authored-by: Lev Lazinskiy <lev@dagger.io>
2024-09-19 23:21:59 -03:00
..
.gitattributes ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
.gitignore ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
build.go ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
go.mod ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
go.sum ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
lint.go ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
main.go ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
run.go ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00
test.go ci: daggerize test pipeline (#4969) 2024-09-19 23:21:59 -03:00