Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport main] #907 - enable windows and macos CI for sql and workbench #962

Merged
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
29 changes: 18 additions & 11 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,32 @@ on:
jobs:
build:
strategy:
# Run all jobs
fail-fast: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was fail fast was disabled here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was mainly for my local dev to run all CI even if one fails. I think it would be useful for future devs to figure out if something is breaking just because of OS, java-version, etc. by running all combinations by default.

matrix:
java:
- 11
- 17
runs-on: ubuntu-latest
entry:
- { os: ubuntu-latest, java: 11 }
- { os: windows-latest, java: 11, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc}
- { os: macos-latest, java: 11, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc }
- { os: ubuntu-latest, java: 17 }
- { os: windows-latest, java: 17, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc }
- { os: macos-latest, java: 17, os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc }
runs-on: ${{ matrix.entry.os }}

steps:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
java-version: ${{ matrix.entry.java }}

- name: Build with Gradle
run: ./gradlew --continue build assemble
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}

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

- name: Create Artifact Path
Expand All @@ -48,7 +55,7 @@ jobs:

# This step uses the codecov-action Github action: https://github.com/codecov/codecov-action
- name: Upload SQL Coverage Report
if: always()
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v3
with:
flags: sql-engine
Expand All @@ -57,11 +64,11 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: opensearch-sql
name: opensearch-sql-${{ matrix.entry.os }}
path: opensearch-sql-builds

- name: Upload test reports
if: always()
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v2
with:
name: test-reports
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/sql-workbench-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ env:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true

- name: Checkout Plugin
uses: actions/checkout@v3

Expand Down Expand Up @@ -51,7 +58,7 @@ jobs:
yarn test:jest --coverage

- name: Upload coverage
if: always()
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v3
with:
flags: query-workbench
Expand All @@ -68,5 +75,6 @@ jobs:
if: always()
uses: actions/upload-artifact@v1 # can't update to v3 because upload fails
with:
name: workbench
name: workbench-${{ matrix.os }}
path: ../OpenSearch-Dashboards/plugins/workbench/build

Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ public void assertFormatterWithoutContentInside() throws IOException {
public void assertFormatterOutputsPrettyJson() throws IOException {
String explainFormattedPrettyFilePath = TestUtils.getResourceFilePath(
"/src/test/resources/expectedOutput/explain_format_pretty.json");
String explainFormattedPretty = Files.toString(new File(explainFormattedPrettyFilePath), StandardCharsets.UTF_8);
String explainFormattedPretty = Files.toString(new File(explainFormattedPrettyFilePath), StandardCharsets.UTF_8)
.replaceAll("\r", "");

String explainFormattedOnelineFilePath = TestUtils.getResourceFilePath(
"/src/test/resources/explain_format_oneline.json");
String explainFormattedOneline = Files.toString(new File(explainFormattedOnelineFilePath), StandardCharsets.UTF_8);
String explainFormattedOneline = Files.toString(new File(explainFormattedOnelineFilePath), StandardCharsets.UTF_8)
.replaceAll("\r", "");
String result = JsonPrettyFormatter.format(explainFormattedOneline);

assertThat(result, equalTo(explainFormattedPretty));
Expand Down
Loading