Skip to content

Commit

Permalink
Use official GH action (#54)
Browse files Browse the repository at this point in the history
* Use official GH action

Signed-off-by: Jordi Deu-Pons <[email protected]>

* Fix workflow

Signed-off-by: Jordi Deu-Pons <[email protected]>

* Fix java launcher

Signed-off-by: Jordi Deu-Pons <[email protected]>

* bump upload-artifact v4

Signed-off-by: Jordi Deu-Pons <[email protected]>

* update gradle

Signed-off-by: Jordi Deu-Pons <[email protected]>

* use GraalVM CE

Signed-off-by: Jordi Deu-Pons <[email protected]>

* use GraalVM CE

Signed-off-by: Jordi Deu-Pons <[email protected]>

* minor changes

---------

Signed-off-by: Jordi Deu-Pons <[email protected]>
Co-authored-by: munishchouhan <[email protected]>
  • Loading branch information
jordeu and munishchouhan authored Sep 25, 2024
1 parent adf439f commit 05a0bac
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 152 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
name: Linux
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
container: public.ecr.aws/seqera-labs/graalvm-static:21.3.0
timeout-minutes: 90

steps:
Expand All @@ -27,20 +26,18 @@ jobs:
fetch-depth: 1

- name: Setup Graalvm
uses: DeLaGuardo/setup-graalvm@master
uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.3.0'
java: 'java11'
arch: 'amd64'

- name: Install native-image component
run: gu install native-image
java-version: '21'
distribution: 'graalvm-community'
native-image-musl: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Tests
run: ./gradlew cleanTest test

- name: Tests reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: linux-test-reports
Expand All @@ -53,15 +50,15 @@ jobs:
run: ./gradlew shadowJar

- name: Upload linux native image artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tw_agent_linux
name: tw-agent-linux
path: build/native/nativeCompile/tw-agent

- name: Upload fat JAR artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tw_agent_jar
name: tw-agent-jar
path: build/libs/tw-agent.jar


Expand All @@ -77,12 +74,13 @@ jobs:
fetch-depth: 0

- name: Download all build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4

- name: Setup Java for JReleaser
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11
java-version: '21'
distribution: 'adopt'

- name: Version
id: version
Expand Down
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=21.3.0.r11-grl
java=21.0.2-graalce
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ task buildInfo {
}

compileJava {
sourceCompatibility = JavaVersion.toVersion("11")
targetCompatibility = JavaVersion.toVersion("11")
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
options.compilerArgs += ["-Aproject=${project.name}"]
dependsOn buildInfo
}
Expand Down Expand Up @@ -121,6 +121,10 @@ graalvmNative {
buildArgs.add('-H:+AddAllCharsets')
buildArgs.add('-H:EnableURLProtocols=https,http')
buildArgs.add('-H:+ReportExceptionStackTraces')

javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
}

test {
Expand Down
18 changes: 0 additions & 18 deletions graalvm-static/Dockerfile

This file was deleted.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
20 changes: 19 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#
# Copyright 2023, Seqera Labs
#
# Licensed 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.
#
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 05a0bac

Please sign in to comment.