forked from opensearch-project/sql
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (85 loc) · 2.71 KB
/
sql-cli-integration-test.yml
File metadata and controls
96 lines (85 loc) · 2.71 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: SQL CLI Integration Test
# This workflow tests sql-cli against the current SQL changes
# to catch breaking changes before they're published
on:
pull_request:
paths:
- '**/*.java'
- '**/*.g4'
- '!sql-jdbc/**'
- '**gradle*'
- '**lombok*'
- 'integ-test/**'
- '**/*.jar'
- '**/*.pom'
- '.github/workflows/sql-cli-integration-test.yml'
push:
branches:
- main
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
paths:
- '**/*.java'
- '**/*.g4'
- '!sql-jdbc/**'
- '**gradle*'
- '**lombok*'
- 'integ-test/**'
- '**/*.jar'
- '**/*.pom'
- '.github/workflows/sql-cli-integration-test.yml'
workflow_dispatch:
jobs:
test-sql-cli-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [21]
steps:
- name: Checkout SQL CLI repository (latest main)
uses: actions/checkout@v4
with:
repository: opensearch-project/sql-cli
path: sql-cli
ref: main
- name: Make a directory for the SQL repo
working-directory: sql-cli
run: mkdir remote
- name: Checkout SQL repository (current changes)
uses: actions/checkout@v4
with:
path: sql-cli/remote/sql
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Build and publish SQL modules to Maven Local
working-directory: sql-cli/remote/sql
run: |
echo "Building SQL modules from current branch..."
./gradlew publishToMavenLocal -x test -x integTest
echo "SQL modules published to Maven Local"
- name: Run SQL CLI tests with local SQL modules
working-directory: sql-cli
run: |
echo "Running SQL CLI tests against local SQL modules..."
./gradlew test -PuseLocalSql=true -PskipSqlRepoPull=true
- name: Upload SQL CLI test reports
if: always()
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: sql-cli-test-reports-java-${{ matrix.java }}
path: |
sql-cli/build/reports/**
sql-cli/build/test-results/**
- name: Test Summary
if: always()
run: |
echo "## SQL CLI Integration Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Tested SQL CLI against SQL changes from: \`${{ github.ref }}\`" >> $GITHUB_STEP_SUMMARY
echo "SQL CLI version: main branch (latest)" >> $GITHUB_STEP_SUMMARY
echo "Java version: ${{ matrix.java }}" >> $GITHUB_STEP_SUMMARY