Skip to content
Merged
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
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: setup
description: Common tasks for preparing the environment

runs:
using: "composite"
steps:
- uses: actions/setup-go@v5
if: runner.os != 'Windows'
with:
go-version-file: go.mod
cache: true
# See https://github.com/actions/setup-go/pull/515
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4
if: runner.os == 'Windows'
with:
go-version-file: go.mod
cache: true
- name: install mage
run: go install github.com/magefile/mage
shell: 'bash'
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directories:
- '/'
- '/.github/actions/*'
schedule:
interval: "weekly"
day: "sunday"
time: "22:00"
reviewers:
- "elastic/observablt-ci"
- "elastic/observablt-ci-contractors"
groups:
github-actions:
patterns:
- "*"
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci

on:
push:
pull_request:
merge_group:

# limit the access of the generated GITHUB_TOKEN
permissions:
contents: read

jobs:

lint:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: |
mage -debug check
go vet ./...

update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: install protoc
run: |
curl -sSfL -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
mkdir -p $GITHUB_WORKSPACE/.protoc
unzip -o protoc.zip -d $GITHUB_WORKSPACE/.protoc
echo "$GITHUB_WORKSPACE/.protoc/bin" >> $GITHUB_PATH

- run: mage -debug update

test:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: go test -v -race ./...
4 changes: 4 additions & 0 deletions pkg/client/chunk/expected_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package chunk

import (
"fmt"
"runtime"
"slices"
"strings"
"testing"
Expand Down Expand Up @@ -254,6 +255,9 @@ func TestExpected(t *testing.T) {
}

func TestRecvExpected_Timestamp_Restart(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping test on Windows for now. See https://github.com/elastic/elastic-agent-client/issues/120#issuecomment-2757564351")
}
firstTimestamp := time.Now()
first := &proto.CheckinExpected{
FeaturesIdx: 2,
Expand Down
4 changes: 4 additions & 0 deletions pkg/client/chunk/observed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package chunk

import (
"fmt"
"runtime"
"slices"
"strings"
"testing"
Expand Down Expand Up @@ -260,6 +261,9 @@ func TestObserved(t *testing.T) {
}

func TestRecvObserved_Timestamp_Restart(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping test on Windows for now. See https://github.com/elastic/elastic-agent-client/issues/120#issuecomment-2757564351")
}
firstTimestamp := time.Now()
first := &proto.CheckinObserved{
Token: "token",
Expand Down