Skip to content

Commit

Permalink
Merge pull request #907 from derek-ho/enable-windows-macos
Browse files Browse the repository at this point in the history
feat: enable ci for windows and macos
  • Loading branch information
derek-ho authored Oct 25, 2022
2 parents bfad32c + 79f765c commit 0699baa
Show file tree
Hide file tree
Showing 8 changed files with 553 additions and 532 deletions.
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
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: ${{ 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

0 comments on commit 0699baa

Please sign in to comment.