sjkaliski / go-github-actions Goto Github PK
View Code? Open in Web Editor NEWGitHub Actions for Golang
License: MIT License
GitHub Actions for Golang
License: MIT License
Add support for go vet
.
This actions work very nicely! The README should mention that they expect to be triggered on pull_request
events. Maybe the code should also check for that and blow up if it's not the right event.
GitHub workflows use YAML as the preferred syntax.
https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
After learning that I found the syntax in the README hard to understand and integrate. Hope you consider switching to yaml or providing ready-to-go alternatives.
Also some other projects have this on their repo homepage:
I think this repo deserves it too.
I have a single main.go in a folder go, but it fails with a curl error when fmt reports files:
go/main.go
curl: (6) Could not resolve host: null
### FAILED go fmt 23:29:39Z (15.78s)
main.workflow:
workflow "Go linter" {
on = "push"
resolves = ["go fmt"]
}
action "go fmt" {
uses = "sjkaliski/go-github-actions/[email protected]"
secrets = ["GITHUB_TOKEN"]
env = {
GO_WORKING_DIR = "."
}
}
Any idea what could be wrong? I also tried without the env variable and with v0.2.0
When there is a compile error, go fmt passes:
// main.go
import (
"log"
)
func main
./main.go:1:1: expected 'package', found 'func'
### SUCCEEDED go fmt 23:38:46Z (10.566s)
It would be great if this would exit as non-succesful.
Add support for go get
.
Currently this project defaults to the latest stable version of Go, 1.11.x, via the golang:1.11
docker image.
A couple questions come up:
For 1, seems like a good option is to update once the new minor version is out and stable & then publish a new release. Any new updates moving forward would only support the latest Go version.
For 2, not sure just yet. Thoughts?
Add support for golint
. E.g.
action "go-lint" {
uses = "sjkaliski/go-github-actions/[email protected]"
needs = "previous-action"
secrets = ["GITHUB_TOKEN"]
env {
GO_WORKING_DIR = "./path/to/go/files"
}
}
Add support for go test
.
Note: This is just a suggestion for the future. Not really necessary but really powerful.
It would be very powerful to have github actions annotate the code like eslint-action does:
A lot of projects will commit their vendored dependencies, or resolve them in CI. A lot of the time, this vendored code is not properly formatted/vetted/etc.
The ability to ignore directories like these might be useful for a broader audience. Usage could potentially look like this:
action "gofmt" {
uses = "sjkaliski/go-github-actions/fmt@..."
...
env {
GO_IGNORE_DIRS = "vendor,internal,some/other/pkg"
}
}
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.