diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml new file mode 100644 index 00000000000000..73580055103373 --- /dev/null +++ b/.github/workflows/native.yml @@ -0,0 +1,57 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: GraalVM Native Image Daily Continuous Integration + +on: +# TODO +# schedule: +# - cron: '0 0 * * *' + pull_request: + branches: + - master + +env: + TARGET_DIR: /home/runner/work/shardingsphere/shardingsphere/shardingsphere-distribution/shardingsphere-proxy-distribution/target + +jobs: + build: + if: github.repository == 'apache/shardingsphere' + timeout-minutes: 90 + permissions: + contents: read + packages: write + name: GraalVM Native Image on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - uses: graalvm/setup-graalvm@v1 + with: + version: '22.2.0' + java-version: '17' + components: 'native-image' + github-token: ${{ secrets.GITHUB_TOKEN }} + cache: 'maven' + # Test TODO + - name: Build with Maven + run: | + ./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-distribution -B -Prelease -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean install + ls -l ${{ env.TARGET_DIR }} + ./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-distribution -B -Pnative -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true clean install \ No newline at end of file diff --git a/pom.xml b/pom.xml index 397a1b83cc3b8e..c1327fcdeae552 100644 --- a/pom.xml +++ b/pom.xml @@ -153,6 +153,7 @@ 2.3.31 2.22.1 2.9.2 + 0.9.13 diff --git a/shardingsphere-distribution/shardingsphere-proxy-distribution/pom.xml b/shardingsphere-distribution/shardingsphere-proxy-distribution/pom.xml index 9f1cb0f81ae38a..5c4ad0e35bf296 100644 --- a/shardingsphere-distribution/shardingsphere-proxy-distribution/pom.xml +++ b/shardingsphere-distribution/shardingsphere-proxy-distribution/pom.xml @@ -219,5 +219,49 @@ + + native + + + + org.graalvm.buildtools + native-maven-plugin + ${native.maven.plugin.version} + true + + + build-native + + build + + package + + + test-native + + test + + test + + + + ${project.build.finalName}-shardingsphere-proxy-bin + org.apache.shardingsphere.proxy.Bootstrap + false + true + + target/${project.build.finalName}-shardingsphere-proxy-bin/conf + . + target/${project.build.finalName}-shardingsphere-proxy-bin/lib/* + target/${project.build.finalName}-shardingsphere-proxy-bin/ext-lib/* + + + true + + + + + +