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

[DONT-MERGE] Testing custome CI image #180

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 5 additions & 6 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/bash

set -euo pipefail

echo "Golang version:"
version=$(cat .go-version)
export GO_VERSION="${version}"
echo "${GO_VERSION}"

# addtional preparation for macos step
if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-libs" && "$BUILDKITE_STEP_KEY" == "test-mac" ]]; then
echo "Golang version:"
version=$(cat .go-version)
export GO_VERSION="${version}"
echo "${GO_VERSION}"

echo "--- prepare env"
source .buildkite/scripts/pre-install-command.sh
with_go ${GO_VERSION} ${SETUP_GVM_VERSION}
Expand Down
30 changes: 22 additions & 8 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
env:
SETUP_MAGE_VERSION: '1.14.0'
ASDF_MAGE_VERSION: '1.14.0'
SETUP_GVM_VERSION: 'v0.5.0'

steps:
- label: ":buildkite: Lint"
command:
- ".buildkite/scripts/lint.sh"
agents:
image: golang:${GO_VERSION}
cpu: "8"
memory: "4G"
provider: gcp
image: family/platform-ingest-eng-prod-base-ubuntu-2204
notify:
- github_commit_status:
context: "Lint"

- label: ":linux: Test Linux"
key: test-lin
command:
- ".buildkite/scripts/test.sh"
agents:
image: golang:${GO_VERSION}
cpu: "8"
memory: "4G"
provider: gcp
image: family/platform-ingest-eng-prod-base-ubuntu-2204
artifact_paths:
- "junit-*.xml"
notify:
- github_commit_status:
context: "Test linux"

- label: ":windows: Test Windows"
key: test-win
Expand All @@ -32,16 +37,25 @@ steps:
image: "family/ci-windows-2019"
artifact_paths:
- "junit-*.xml"
notify:
- github_commit_status:
context: "Test windows 2019"

- label: ":mac: Test MacOS"
key: test-mac
command:
- ".buildkite/scripts/test.sh junit-report-macos.xml"
command: |
echo "--- Pre install"
source .buildkite/scripts/pre-install-command.sh
with_go_junit_report
.buildkite/scripts/test.sh junit-report-macos.xml
agents:
provider: "orka"
imagePrefix: generic-13-ventura-x64
artifact_paths:
- "junit-*.xml"
notify:
- github_commit_status:
context: "Test MacOS"

- label: ":junit: Junit annotate"
plugins:
Expand Down
6 changes: 0 additions & 6 deletions .buildkite/scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash

set -euo pipefail

echo "--- Pre install"
source .buildkite/scripts/pre-install-command.sh
add_bin_path
with_mage

echo "--- Mage notice"
mage notice

Expand Down
7 changes: 0 additions & 7 deletions .buildkite/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/bin/bash
junitfile=$1 # filename for jnit annotation plugin

set -euo pipefail

echo "--- Pre install"
source .buildkite/scripts/pre-install-command.sh
go version
add_bin_path
with_go_junit_report

echo "--- Go Test"
set +e
go test -v ./... > tests-report.txt
Expand Down
Loading