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 15 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
28 changes: 20 additions & 8 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,25 @@ on:

jobs:
build:
env:
BUILD_ARGS: ${{ matrix.os_build_args }}
strategy:
# Run all jobs
fail-fast: false
matrix:
java:
- 11
- 17
runs-on: ubuntu-latest
java: [11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Personally I think it is cleaner as is, there is less lines to maintain instead of manually enumerating all combinations. Will wait for repo maintainers to review and we can go with whatever they think is best.

Choose a reason for hiding this comment

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

I am +1 to Daniel's comment. I'd rather see the json-looking iterations. Sometime in the future we may want to change which mixes of jvm+os are supported, and it's much easier to pick and choose as time goes on.

For instance, jvm 20 comes out, but it only builds correctly on {linux} for nearly a year.
Do we not test jvm20 at all until it can build on all three os? Or do we supply "proof" of tested environemnt for those environments that we can show?
I favor being able to test what we can when we can.

Thoughts @dblock ?

- os: windows-latest
os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Disabled doctest/integTest for now, created an issue to enable them in the future
#921

- os: macos-latest
os_build_args: -x doctest -x integTest -x jacocoTestReport -x compileJdbc
runs-on: ${{ matrix.os }}

steps:
- name: Change line endings for windows
if: ${{ matrix.os == 'windows-latest' }}
run: git config --global core.autocrlf input
joshuali925 marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
Expand All @@ -36,9 +47,10 @@ jobs:
java-version: ${{ matrix.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.os == 'ubuntu-latest' }}
Copy link
Member

Choose a reason for hiding this comment

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

Does this not work on other platforms?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, this is blocked on opensearch-project/opensearch-plugins#95 (comment). I'm not sure if we should block this PR on that decision @dblock

Choose a reason for hiding this comment

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

@dblock could this be configured in an extended matrix.entry list? Each jvm+os also carries flags on wether it should upload, run-backward-compat-test, etc?

run: ./scripts/bwctest.sh

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

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

- name: Upload test reports
if: always()
if: ${{ matrix.os == 'ubuntu-latest' }}
Yury-Fridlyand marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/upload-artifact@v2
with:
name: test-reports
Expand Down
15 changes: 11 additions & 4 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,5 @@ jobs:
if: always()
uses: actions/upload-artifact@v1 # can't update to v3 because upload fails
with:
name: workbench
path: ../OpenSearch-Dashboards/plugins/workbench/build
name: workbench-${{ matrix.os }}
path: ../OpenSearch-Dashboards/plugins/workbench/build
Yury-Fridlyand marked this conversation as resolved.
Show resolved Hide resolved
Loading