feat: autogen GH workflows and split build, test, and publish (#971)
Closes https://github.com/ooni/probe/issues/2337.
This commit is contained in:
parent
89a584f93b
commit
5466f30526
14 changed files with 990 additions and 142 deletions
76
GHGEN/config.go
Normal file
76
GHGEN/config.go
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
package main
|
||||
|
||||
//
|
||||
// Configuration with which we will run
|
||||
//
|
||||
|
||||
import "io"
|
||||
|
||||
// Job is a job to run.
|
||||
type Job struct {
|
||||
// Action is the job name
|
||||
Action func(w io.Writer, job *Job)
|
||||
|
||||
// ArchsMatrix contains the architectures to iterate over
|
||||
ArchsMatrix []string
|
||||
}
|
||||
|
||||
// Config contains the configuration.
|
||||
var Config = map[string][]Job{
|
||||
"android": {{
|
||||
Action: buildAndPublishMobileAndroid,
|
||||
ArchsMatrix: []string{},
|
||||
}, {
|
||||
Action: buildAndPublishCLIAndroid,
|
||||
ArchsMatrix: []string{
|
||||
"386",
|
||||
"amd64",
|
||||
"arm",
|
||||
"arm64",
|
||||
},
|
||||
}},
|
||||
"ios": {{
|
||||
Action: buildAndPublishMobileIOS,
|
||||
ArchsMatrix: []string{},
|
||||
}},
|
||||
"linux": {{
|
||||
Action: buildAndPublishCLILinux,
|
||||
ArchsMatrix: []string{
|
||||
"386",
|
||||
"amd64",
|
||||
"armv6",
|
||||
"armv7",
|
||||
"arm64",
|
||||
},
|
||||
}},
|
||||
"macos": {{
|
||||
Action: buildAndPublishCLIMacOS,
|
||||
ArchsMatrix: []string{},
|
||||
}},
|
||||
"windows": {{
|
||||
Action: buildAndPublishCLIWindows,
|
||||
ArchsMatrix: []string{},
|
||||
}},
|
||||
}
|
||||
|
||||
const (
|
||||
// runOnUbuntu is the Ubuntu system where to run.
|
||||
runsOnUbuntu = "ubuntu-20.04"
|
||||
|
||||
// runsOnMacOS is the macOS system where to run.
|
||||
runsOnMacOS = "macos-11"
|
||||
|
||||
// runsOnWindows is the windows system where to run.
|
||||
runsOnWindows = "windows-2019"
|
||||
)
|
||||
|
||||
// noPermission indicates a job does not require permissions.
|
||||
var noPermissions map[string]string
|
||||
|
||||
// contentsWritePermissions indicates the job needs the `contents: write` permission.
|
||||
var contentsWritePermissions = map[string]string{
|
||||
"contents": "write",
|
||||
}
|
||||
|
||||
// noDependencies indicates a job does not require dependencies.
|
||||
var noDependencies string
|
||||
Loading…
Reference in a new issue