Repository navigation
71 lines (68 loc) · 3.29 KB
/
Copy pathelasticsearch-java-docs.yml
File metadata and controls
71 lines (68 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Elasticsearch Java documentation
on:
pull_request:
branches: [main]
paths:
- src/pages/docs/integrations/traceai/java/vector-databases.mdx
- scripts/java-elasticsearch/**
- scripts/crewai-ingestion-check/**
- .github/workflows/elasticsearch-java-docs.yml
permissions:
contents: read
jobs:
native-tracing:
name: Native tracing (Java ${{ matrix.java }}, Elasticsearch ${{ matrix.elasticsearch }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
java: ['17', '21']
elasticsearch: ['8.12.0', '9.5.5']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Check out the production ingestion contract
uses: actions/checkout@v4
with:
repository: future-agi/future-agi
ref: 215b19543a47de8c7ae7e8dc452dc267440e5c8d
path: .test-deps/future-agi
sparse-checkout: fi-collector
persist-credentials: false
- uses: actions/setup-go@v5
with:
go-version-file: .test-deps/future-agi/fi-collector/go.mod
cache-dependency-path: .test-deps/future-agi/fi-collector/go.sum
- name: Resolve production converter dependencies
working-directory: .test-deps/future-agi/fi-collector
run: go mod download
- name: Extract executable snippets and check the page contract
run: node scripts/java-elasticsearch/extract.mjs
- name: Resolve released dependencies before denying outbound networking
run: |
# sudo changes Java's user.home even when HOME is preserved.
export MAVEN_REPO="$RUNNER_TEMP/elasticsearch-m2"
echo "MAVEN_REPO=$MAVEN_REPO" >> "$GITHUB_ENV"
mvn -B -Dmaven.repo.local="$MAVEN_REPO" -f scripts/java-elasticsearch/pom.xml -Delasticsearch.version=${{ matrix.elasticsearch }} dependency:go-offline
mvn -B -Dmaven.repo.local="$MAVEN_REPO" -f scripts/java-elasticsearch/target/native-consumer/pom.xml -Delasticsearch.version=${{ matrix.elasticsearch }} dependency:go-offline
- name: Package the exact native example and test with loopback networking only
env:
ES_VERSION: ${{ matrix.elasticsearch }}
run: |
export INGESTION_CHECK="$RUNNER_TEMP/elasticsearch-ingestion-check"
sudo --preserve-env=JAVA_HOME,ES_VERSION,INGESTION_CHECK,MAVEN_REPO env PATH="$PATH" HOME="$HOME" \
unshare --net sh -ec '
ip link set lo up
ROOT="$PWD"
(cd .test-deps/future-agi/fi-collector && GOPROXY=off go build -o "$INGESTION_CHECK" "$ROOT/scripts/crewai-ingestion-check/main.go")
mvn -o -B -Dmaven.repo.local="$MAVEN_REPO" -f scripts/java-elasticsearch/target/native-consumer/pom.xml -Delasticsearch.version="$ES_VERSION" -DskipTests package dependency:build-classpath -Dmdep.outputFile=target/classpath.txt
mvn -o -B -Dmaven.repo.local="$MAVEN_REPO" -f scripts/java-elasticsearch/pom.xml -Delasticsearch.version="$ES_VERSION" test
node scripts/java-elasticsearch/check-ingestion.mjs "$INGESTION_CHECK" "$ES_VERSION"
'