Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: run mage with "-v" to not discard output, and move mage to a submodule #1238

Merged
merged 2 commits into from Feb 19, 2021

Conversation

thaJeztah
Copy link
Collaborator

travis: run mage with -v to not discard output

Before this:

$ go run mage.go lint
Error: running "/Users/sebastiaan/go/bin/golangci-lint run ./..." failed with exit code 1
exit status 1

$ go run mage.go test
Error: running "go test -race -v ./..." failed with exit code 1
exit status 1

After this:

$ go run mage.go -v lint
Running target: Lint
exec: /Users/sebastiaan/go/bin/golangci-lint run ./...
entry.go:89:6: `iamNotUsed` is unused (deadcode)
func iamNotUsed() {
     ^
Error: running "/Users/sebastiaan/go/bin/golangci-lint run ./..." failed with exit code 1
exit status 1

$ go run mage.go -v test
Running target: Test
exec: go test -race -v ./...
=== RUN   TestRegister
...
?   	github.com/sirupsen/logrus/internal/testutils	[no test files]
FAIL
Error: running "go test -race -v ./..." failed with exit code 1
exit status 1

move "mage" to a separate module

Move the magefile related files to a submodule, so that it does not become a dependency for logrus itself.

Before this:

    $ go run mage.go lint
    Error: running "/Users/sebastiaan/go/bin/golangci-lint run ./..." failed with exit code 1
    exit status 1

    $ go run mage.go test
    Error: running "go test -race -v ./..." failed with exit code 1
    exit status 1

After this:

    $ go run mage.go -v lint
    Running target: Lint
    exec: /Users/sebastiaan/go/bin/golangci-lint run ./...
    entry.go:89:6: `iamNotUsed` is unused (deadcode)
    func iamNotUsed() {
         ^
    Error: running "/Users/sebastiaan/go/bin/golangci-lint run ./..." failed with exit code 1
    exit status 1

    $ go run mage.go -v test
    Running target: Test
    exec: go test -race -v ./...
    === RUN   TestRegister
    ...
    ?   	github.com/sirupsen/logrus/internal/testutils	[no test files]
    FAIL
    Error: running "go test -race -v ./..." failed with exit code 1
    exit status 1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Move the magefile related files to a submodule, so that it
does not become a dependency for logrus itself.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review February 19, 2021 11:59
@thaJeztah
Copy link
Collaborator Author

@dgsb PTAL

Wondering; perhaps we should move to GitHub actions, now that travis-ci.org is shutting down (and there's ready-made actions for Golang and Golang-ci-lint). Looking at the magefile, it's only doing some minimal things, which could be handled by some standard GH actions.

(I'll try to prepare a PR for that for consideration)

@dgsb
Copy link
Collaborator

dgsb commented Feb 19, 2021

@thaJeztah thanks, that's a clever trick.

Regarding github action I'd rather not move things out from the magefile, the purpose is to get independant as much as possible from the CI system whatever it is so that any migration when needed is seamless.

@dgsb dgsb merged commit f104497 into sirupsen:master Feb 19, 2021
@thaJeztah thaJeztah deleted the move_mage branch February 19, 2021 12:54
@thaJeztah
Copy link
Collaborator Author

Regarding github action I'd rather not move things out from the magefile, the purpose is to get independant as much as possible from the CI system whatever it is so that any migration when needed is seamless.

Got distracted by other pull requests I was working on, but I opened #1239 to look at / discuss what GH Actions could look like 🤗

This was referenced Mar 9, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants