Skip to content

Commit c525c13

Browse files
authored
github-actions: for the CI (#130)
1 parent e55ad4e commit c525c13

File tree

5 files changed

+95
-0
lines changed

5 files changed

+95
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: setup
3+
description: Common tasks for preparing the environment
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- uses: actions/setup-go@v5
9+
if: runner.os != 'Windows'
10+
with:
11+
go-version-file: go.mod
12+
cache: true
13+
# See https://github.com/actions/setup-go/pull/515
14+
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4
15+
if: runner.os == 'Windows'
16+
with:
17+
go-version-file: go.mod
18+
cache: true
19+
- name: install mage
20+
run: go install github.com/magefile/mage
21+
shell: 'bash'

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directories:
6+
- '/'
7+
- '/.github/actions/*'
8+
schedule:
9+
interval: "weekly"
10+
day: "sunday"
11+
time: "22:00"
12+
reviewers:
13+
- "elastic/observablt-ci"
14+
- "elastic/observablt-ci-contractors"
15+
groups:
16+
github-actions:
17+
patterns:
18+
- "*"

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
merge_group:
7+
8+
# limit the access of the generated GITHUB_TOKEN
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
14+
lint:
15+
strategy:
16+
matrix:
17+
os: ['ubuntu-latest', 'windows-latest']
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: ./.github/actions/setup
22+
- run: |
23+
mage -debug check
24+
go vet ./...
25+
26+
update:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: ./.github/actions/setup
31+
- name: install protoc
32+
run: |
33+
curl -sSfL -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-linux-x86_64.zip
34+
mkdir -p $GITHUB_WORKSPACE/.protoc
35+
unzip -o protoc.zip -d $GITHUB_WORKSPACE/.protoc
36+
echo "$GITHUB_WORKSPACE/.protoc/bin" >> $GITHUB_PATH
37+
38+
- run: mage -debug update
39+
40+
test:
41+
strategy:
42+
matrix:
43+
os: ['ubuntu-latest', 'windows-latest']
44+
runs-on: ${{ matrix.os }}
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: ./.github/actions/setup
48+
- run: go test -v -race ./...

pkg/client/chunk/expected_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package chunk
66

77
import (
88
"fmt"
9+
"runtime"
910
"slices"
1011
"strings"
1112
"testing"
@@ -254,6 +255,9 @@ func TestExpected(t *testing.T) {
254255
}
255256

256257
func TestRecvExpected_Timestamp_Restart(t *testing.T) {
258+
if runtime.GOOS == "windows" {
259+
t.Skip("Skipping test on Windows for now. See https://github.com/elastic/elastic-agent-client/issues/120#issuecomment-2757564351")
260+
}
257261
firstTimestamp := time.Now()
258262
first := &proto.CheckinExpected{
259263
FeaturesIdx: 2,

pkg/client/chunk/observed_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package chunk
66

77
import (
88
"fmt"
9+
"runtime"
910
"slices"
1011
"strings"
1112
"testing"
@@ -260,6 +261,9 @@ func TestObserved(t *testing.T) {
260261
}
261262

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

0 commit comments

Comments
 (0)