forked from nolte/plumbing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magefile.go
44 lines (35 loc) · 922 Bytes
/
magefile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//+build mage
package main
import (
"context"
"github.com/magefile/mage/mg"
// mage:import
"github.com/nolte/plumbing/cmd/golang"
"github.com/nolte/plumbing/pkg"
)
// GitHubWorkflow Mage Command Namespace.
type GitHubWorkflow mg.Namespace
// All Targets in a pipeline.
func All(ctx context.Context) {
mg.CtxDeps(ctx, golang.Golang.StaticTests)
mg.SerialCtxDeps(ctx, GitHubWorkflow.GH)
}
// GH will be run all GitHub Actions Locally.
func (GitHubWorkflow) GH(ctx context.Context) {
mg.SerialCtxDeps(ctx, GitHubWorkflow.GHBuild)
mg.SerialCtxDeps(ctx, GitHubWorkflow.GHLint)
}
// GHLint start the Github lint Workflow.
func (GitHubWorkflow) GHLint(ctx context.Context) error {
job := pkg.ActJob{
Name: "lint",
}
return job.Execute()
}
// GHBuild start the Github build Workflow.
func (GitHubWorkflow) GHBuild(ctx context.Context) error {
job := pkg.ActJob{
Name: "build",
}
return job.Execute()
}