Skip to content

Commit e36738a

Browse files
committed
Merge pull request opensearch-project#907 from derek-ho/enable-windows-macos
feat: enable ci for windows and macos (cherry picked from commit 0699baa)
1 parent e733e7b commit e36738a

File tree

8 files changed

+553
-532
lines changed

8 files changed

+553
-532
lines changed

.github/workflows/sql-test-and-build-workflow.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,32 @@ on:
2020
jobs:
2121
build:
2222
strategy:
23+
# Run all jobs
24+
fail-fast: false
2325
matrix:
24-
java:
25-
- 11
26-
- 17
27-
runs-on: ubuntu-latest
26+
entry:
27+
- { os: ubuntu-latest, java: 11 }
28+
- { os: windows-latest, java: 11, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc}
29+
- { os: macos-latest, java: 11, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc }
30+
- { os: ubuntu-latest, java: 17 }
31+
- { os: windows-latest, java: 17, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc }
32+
- { os: macos-latest, java: 17, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc }
33+
runs-on: ${{ matrix.entry.os }}
2834

2935
steps:
3036
- uses: actions/checkout@v3
31-
37+
3238
- name: Set up JDK ${{ matrix.java }}
3339
uses: actions/setup-java@v3
3440
with:
3541
distribution: 'temurin'
36-
java-version: ${{ matrix.java }}
37-
42+
java-version: ${{ matrix.entry.java }}
43+
3844
- name: Build with Gradle
39-
run: ./gradlew --continue build assemble
45+
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}
4046

4147
- name: Run backward compatibility tests
48+
if: ${{ matrix.entry.os == 'ubuntu-latest' }}
4249
run: ./scripts/bwctest.sh
4350

4451
- name: Create Artifact Path
@@ -48,7 +55,7 @@ jobs:
4855
4956
# This step uses the codecov-action Github action: https://github.com/codecov/codecov-action
5057
- name: Upload SQL Coverage Report
51-
if: always()
58+
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
5259
uses: codecov/codecov-action@v3
5360
with:
5461
flags: sql-engine
@@ -57,11 +64,11 @@ jobs:
5764
- name: Upload Artifacts
5865
uses: actions/upload-artifact@v2
5966
with:
60-
name: opensearch-sql
67+
name: opensearch-sql-${{ matrix.entry.os }}
6168
path: opensearch-sql-builds
6269

6370
- name: Upload test reports
64-
if: always()
71+
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
6572
uses: actions/upload-artifact@v2
6673
with:
6774
name: test-reports

.github/workflows/sql-workbench-test-and-build-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ env:
1616

1717
jobs:
1818
build:
19-
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
os: [ubuntu-latest, windows-latest, macos-latest]
22+
runs-on: ${{ matrix.os }}
2023
steps:
24+
- name: Enable longer filenames
25+
if: ${{ matrix.os == 'windows-latest' }}
26+
run: git config --system core.longpaths true
27+
2128
- name: Checkout Plugin
2229
uses: actions/checkout@v3
2330

@@ -51,7 +58,7 @@ jobs:
5158
yarn test:jest --coverage
5259
5360
- name: Upload coverage
54-
if: always()
61+
if: ${{ matrix.os == 'ubuntu-latest' }}
5562
uses: codecov/codecov-action@v3
5663
with:
5764
flags: query-workbench
@@ -68,5 +75,6 @@ jobs:
6875
if: always()
6976
uses: actions/upload-artifact@v1 # can't update to v3 because upload fails
7077
with:
71-
name: workbench
78+
name: workbench-${{ matrix.os }}
7279
path: ../OpenSearch-Dashboards/plugins/workbench/build
80+

legacy/src/test/java/org/opensearch/sql/legacy/unittest/utils/PrettyFormatterTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ public void assertFormatterWithoutContentInside() throws IOException {
3131
public void assertFormatterOutputsPrettyJson() throws IOException {
3232
String explainFormattedPrettyFilePath = TestUtils.getResourceFilePath(
3333
"/src/test/resources/expectedOutput/explain_format_pretty.json");
34-
String explainFormattedPretty = Files.toString(new File(explainFormattedPrettyFilePath), StandardCharsets.UTF_8);
34+
String explainFormattedPretty = Files.toString(new File(explainFormattedPrettyFilePath), StandardCharsets.UTF_8)
35+
.replaceAll("\r", "");
3536

3637
String explainFormattedOnelineFilePath = TestUtils.getResourceFilePath(
3738
"/src/test/resources/explain_format_oneline.json");
38-
String explainFormattedOneline = Files.toString(new File(explainFormattedOnelineFilePath), StandardCharsets.UTF_8);
39+
String explainFormattedOneline = Files.toString(new File(explainFormattedOnelineFilePath), StandardCharsets.UTF_8)
40+
.replaceAll("\r", "");
3941
String result = JsonPrettyFormatter.format(explainFormattedOneline);
4042

4143
assertThat(result, equalTo(explainFormattedPretty));

0 commit comments

Comments
 (0)