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

feat: enable ci for windows and macos #907

Merged
merged 26 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2661232
initial commit for sql workbench windows and macos
derek-ho Oct 12, 2022
7a1c7ae
name files
derek-ho Oct 12, 2022
ef535e9
clean up code with matrix
derek-ho Oct 13, 2022
8a58eb9
forgot comma
derek-ho Oct 13, 2022
828101c
use cross env for windows and enable windows and macos ci in sql
derek-ho Oct 13, 2022
53ef534
disable integration and jacoco for windows and mac
derek-ho Oct 13, 2022
7569d6d
add gitattributes file to normalize line endings
derek-ho Oct 13, 2022
912731b
move gitattributes into appropriate folder
derek-ho Oct 13, 2022
6a6cfd6
configure line endings for windows
derek-ho Oct 13, 2022
0d016ef
fix one test file and get rid of git attributes
derek-ho Oct 14, 2022
a8709d2
disable doctest and integ test
derek-ho Oct 14, 2022
d4c9f1e
fix up tests
derek-ho Oct 17, 2022
9df2acd
fix tests and add java docs
derek-ho Oct 17, 2022
8f98fa4
revert error format
derek-ho Oct 17, 2022
7a39dcb
revert pretty format response
derek-ho Oct 17, 2022
bd8572a
revert error formatter test file
derek-ho Oct 17, 2022
a2b473b
replace carriage return with nothing
derek-ho Oct 18, 2022
a3747a3
remove windows git config
derek-ho Oct 18, 2022
e70df11
fix PR comments and fail test on purpose to see if upload test report…
derek-ho Oct 19, 2022
de65184
fix matrix entry
derek-ho Oct 19, 2022
a6f3ceb
remove test failure
derek-ho Oct 19, 2022
3f372bb
fix up to run on right os
derek-ho Oct 20, 2022
5e24f3c
fix up indentation
derek-ho Oct 20, 2022
3fbe3e4
remove env. build_args to make it cleaner
derek-ho Oct 20, 2022
954c072
try removing env var
derek-ho Oct 20, 2022
79f765c
remove unecessary import
derek-ho Oct 20, 2022
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
31 changes: 20 additions & 11 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,35 @@ on:

jobs:
build:
env:
BUILD_ARGS: ${{ matrix.entry.os_build_args }}
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 ${{ env.BUILD_ARGS }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is assemble unnecessary here? It seems build includes assemble:
https://stackoverflow.com/a/44185464

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can use there

Suggested change
run: ./gradlew --continue build ${{ env.BUILD_ARGS }}
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right this is cleaner let me do this


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

- name: Create Artifact Path
Expand All @@ -48,7 +57,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 +66,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", "");
joshuali925 marked this conversation as resolved.
Show resolved Hide resolved
String result = JsonPrettyFormatter.format(explainFormattedOneline);

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