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
42
GHGEN/macos.go
Normal file
42
GHGEN/macos.go
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package main
|
||||
|
||||
//
|
||||
// Generates the macOS workflow.
|
||||
//
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/runtimex"
|
||||
)
|
||||
|
||||
func buildAndPublishCLIMacOS(w io.Writer, job *Job) {
|
||||
runtimex.Assert(len(job.ArchsMatrix) <= 0, "expected no architecture matrix")
|
||||
|
||||
buildJob := "build_darwin_cli"
|
||||
artifacts := []string{
|
||||
"./CLI/ooniprobe-darwin-amd64",
|
||||
"./CLI/ooniprobe-darwin-arm64",
|
||||
"./CLI/miniooni-darwin-amd64",
|
||||
"./CLI/miniooni-darwin-arm64",
|
||||
}
|
||||
testJob := "test_darwin_cli"
|
||||
publishJob := "publish_darwin_cli"
|
||||
|
||||
newJob(w, buildJob, runsOnMacOS, noDependencies, noPermissions)
|
||||
newStepCheckout(w)
|
||||
newStepSetupGo(w, "macos")
|
||||
newStepSetupPsiphon(w)
|
||||
newStepMake(w, "CLI/darwin")
|
||||
newStepUploadArtifacts(w, artifacts)
|
||||
|
||||
newJob(w, testJob, runsOnMacOS, buildJob, noPermissions)
|
||||
newStepCheckout(w)
|
||||
newStepDownloadArtifacts(w, []string{"ooniprobe-darwin-amd64"})
|
||||
newStepRunOONIProbeIntegrationTests(w, "darwin", "amd64", "")
|
||||
|
||||
newJob(w, publishJob, runsOnMacOS, testJob, contentsWritePermissions)
|
||||
newStepCheckout(w)
|
||||
newStepDownloadArtifacts(w, artifacts)
|
||||
newStepGHPublish(w, artifacts)
|
||||
}
|
||||
Loading…
Reference in a new issue