feat: autogen GH workflows and split build, test, and publish (#971)

Closes https://github.com/ooni/probe/issues/2337.
This commit is contained in:
Simone Basso 2022-10-03 14:20:54 +02:00 committed by GitHub
commit 5466f30526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 990 additions and 142 deletions

42
GHGEN/macos.go Normal file
View 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)
}