Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Github actions workflow to build on MacOS #28906

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,39 @@ def k8sTest(Map args = [:]) {
}
}

/**
* This method runs the GitHub action
*/
def githubAction(Map args = [:]) {
// We don't support branches/tags for the time being.
if (!isPR()) { return }
// Notify the status with a specific GitHub Check
withGithubNotify(context: args.context) {
// Provision a worker with the given labels. For the time being, let's provision a worker.
// We can revisit this to maybe use the async mode when triggering the github action.
withNode(labels: args.label, forceWorkspace: true){
// TODO: This is the section regarding how to run the GitHub actions.
nxei marked this conversation as resolved.
Show resolved Hide resolved
// Just calling the step from https://github.com/elastic/apm-pipeline-library/pull/1358
// Environment variables:
// env.GIT_BASE_COMMIT, this environment variable points to the git ref commit.
// env.TARGET_BRANCH, this environment variable points to the target branch in a Pull Request.
// env.GO_VERSION, this environment variable points to the Golang version.
nxei marked this conversation as resolved.
Show resolved Hide resolved
def result = githubWorkflowRun(
repo: "elastic/beats",
nxei marked this conversation as resolved.
Show resolved Hide resolved
workflow: "build",
nxei marked this conversation as resolved.
Show resolved Hide resolved
ref: env.TARGET_BRANCH,
parameters: [
pr: env.CHANGE_ID,
path: args.directory,
command: args.command,
go_version: env.GO_VERSION,
])
log(level: 'INFO', text: "Github build link: ${$result.html_url}")
nxei marked this conversation as resolved.
Show resolved Hide resolved
log(level: 'INFO', text: "Github build status: ${result.conclusion}")
}
}
}

/**
* This method runs the packaging for ARM
*/
Expand Down Expand Up @@ -1145,6 +1178,14 @@ class RunCommand extends co.elastic.beats.BeatsFunction {
if(args?.content?.containsKey('cloud')) {
steps.cloud(context: args.context, command: args.content.cloud, directory: args.project, label: args.label, withModule: withModule, dirs: args.content.dirs, id: args.id, withAWS: withAWS)
}
if(args?.content?.containsKey('githubAction')) {
steps.githubAction(context: args.context,
command: args.content.githubAction,
directory: args.project,
label: args.label,
id: args.id,
enableRetry: enableRetry)
}
}
}
}
Expand Down
38 changes: 19 additions & 19 deletions Jenkinsfile.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
projects:
- "auditbeat"
- "deploy/kubernetes"
- "filebeat"
- "heartbeat"
- "libbeat"
- "metricbeat"
- "packetbeat"
- "winlogbeat"
- "x-pack/auditbeat"
- "x-pack/dockerlogbeat"
- "x-pack/elastic-agent"
- "x-pack/filebeat"
- "x-pack/functionbeat"
- "x-pack/heartbeat"
- "x-pack/libbeat"
- "x-pack/metricbeat"
- "x-pack/osquerybeat"
- "x-pack/packetbeat"
- "x-pack/winlogbeat"
- "dev-tools"
# - "deploy/kubernetes"
# - "filebeat"
# - "heartbeat"
# - "libbeat"
# - "metricbeat"
# - "packetbeat"
# - "winlogbeat"
# - "x-pack/auditbeat"
# - "x-pack/dockerlogbeat"
# - "x-pack/elastic-agent"
# - "x-pack/filebeat"
# - "x-pack/functionbeat"
# - "x-pack/heartbeat"
# - "x-pack/libbeat"
# - "x-pack/metricbeat"
# - "x-pack/osquerybeat"
# - "x-pack/packetbeat"
# - "x-pack/winlogbeat"
# - "dev-tools"

## Changeset macros that are defined here and used in each specific 2.0 pipeline.
changeset:
Expand Down
186 changes: 96 additions & 90 deletions auditbeat/Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,75 @@ when:
tags: true ## for all the tags
platform: "immutable && ubuntu-18" ## default label for all the stages
stages:
lint:
make: |
make -C auditbeat check;
make -C auditbeat update;
make -C x-pack/auditbeat check;
make -C x-pack/auditbeat update;
make check-no-changes;
stage: lint
arm:
mage: "mage build unitTest"
platforms: ## override default label in this specific stage.
- "arm"
when: ## Override the top-level when.
comments:
- "/test auditbeat for arm"
labels:
- "arm"
parameters:
- "armTest"
branches: true ## for all the branches
tags: true ## for all the tags
stage: extended
unitTest:
mage: "mage build unitTest"
stage: mandatory
crosscompile:
make: "make -C auditbeat crosscompile"
stage: mandatory
macos:
mage: "mage build unitTest"
platforms: ## override default label in this specific stage.
- "macosx&&x86_64"
when: ## Override the top-level when.
comments:
- "/test auditbeat for macos"
labels:
- "macOS"
parameters:
- "macosTest"
tags: true ## for all the tags
stage: extended
windows:
mage: "mage build unitTest"
platforms: ## override default labels in this specific stage.
- "windows-2019"
stage: mandatory
windows-2016:
mage: "mage build unitTest"
platforms: ## override default labels in this specific stage.
- "windows-2016"
stage: extended
windows-2012:
mage: "mage build unitTest"
platforms: ## override default labels in this specific stage.
- "windows-2012-r2"
stage: extended
windows-10:
mage: "mage build unitTest"
platforms: ## override default labels in this specific stage.
- "windows-10"
stage: extended
windows-8:
mage: "mage build unitTest"
platforms: ## override default labels in this specific stage.
- "windows-8"
stage: extended
# lint:
# make: |
# make -C auditbeat check;
# make -C auditbeat update;
# make -C x-pack/auditbeat check;
# make -C x-pack/auditbeat update;
# make check-no-changes;
# stage: lint
# arm:
# mage: "mage build unitTest"
# platforms: ## override default label in this specific stage.
# - "arm"
# when: ## Override the top-level when.
# comments:
# - "/test auditbeat for arm"
# labels:
# - "arm"
# parameters:
# - "armTest"
# branches: true ## for all the branches
# tags: true ## for all the tags
# stage: extended
# unitTest:
# mage: "mage build unitTest"
# stage: mandatory
# crosscompile:
# make: "make -C auditbeat crosscompile"
# stage: mandatory
# macosActions:
# githubAction: "mage build unitTest"
# stage: extended
# macos:
# mage: "mage build unitTest"
# platforms: ## override default label in this specific stage.
# - "macosx&&x86_64"
# when: ## Override the top-level when.
# comments:
# - "/test auditbeat for macos"
# labels:
# - "macOS"
# parameters:
# - "macosTest"
# tags: true ## for all the tags
# stage: extended
# windows:
# mage: "mage build unitTest"
# platforms: ## override default labels in this specific stage.
# - "windows-2019"
# stage: mandatory
# windows-2016:
# mage: "mage build unitTest"
# platforms: ## override default labels in this specific stage.
# - "windows-2016"
# stage: extended
# windows-2012:
# mage: "mage build unitTest"
# platforms: ## override default labels in this specific stage.
# - "windows-2012-r2"
# stage: extended
# windows-10:
# mage: "mage build unitTest"
# platforms: ## override default labels in this specific stage.
# - "windows-10"
# stage: extended
# windows-8:
# mage: "mage build unitTest"
# platforms: ## override default labels in this specific stage.
# - "windows-8"
# stage: extended
#windows-2008: See https://github.com/elastic/beats/issues/19799
# mage: "mage build unitTest"
# platforms: ## override default labels in this specific stage.
Expand All @@ -94,27 +97,30 @@ stages:
# platforms: ## override default labels in this specific stage.
# - "windows-7-32-bit"
# stage: extended
packaging-linux:
packaging-linux: "mage package"
e2e:
enabled: false
stage: packaging
when:
branches: false ## Only on a PR basis for the time being
tags: false ## packaging on branches/tags is already in place with the downstream build.
changeset: ## when PR contains any of those entries in the changeset
- "^auditbeat/.*"
- "@oss" ## special token regarding the changeset for the oss
packaging-arm:
packaging-arm: "mage package"
e2e:
enabled: false
platforms: ## override default label in this specific stage.
- "arm"
stage: packaging
when:
branches: false ## Only on a PR basis for the time being
tags: false ## packaging on branches/tags is already in place with the downstream build.
changeset: ## when PR contains any of those entries in the changeset
- "^auditbeat/.*"
- "@oss" ## special token regarding the changeset for the oss
# packaging-linux:
# packaging-linux: "mage package"
# e2e:
# enabled: false
# stage: packaging
# when:
# branches: false ## Only on a PR basis for the time being
# tags: false ## packaging on branches/tags is already in place with the downstream build.
# changeset: ## when PR contains any of those entries in the changeset
# - "^auditbeat/.*"
# - "@oss" ## special token regarding the changeset for the oss
# packaging-arm:
# packaging-arm: "mage package"
# e2e:
# enabled: false
# platforms: ## override default label in this specific stage.
# - "arm"
# stage: packaging
# when:
# branches: false ## Only on a PR basis for the time being
# tags: false ## packaging on branches/tags is already in place with the downstream build.
# changeset: ## when PR contains any of those entries in the changeset
# - "^auditbeat/.*"
# - "@oss" ## special token regarding the changeset for the oss
macosActions:
githubAction: "mage build unitTest"
stage: mandatory