diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..c061df7f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +name: Main + +on: + pull_request: + types: + - opened + - synchronized + - reopened + push: + branches: + - main + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + architecture: x64 + cache: maven + + - name: Download all dependencies + run: | + # Download all dependencies that integration tests might need later + ./mvnw -B -V -Dstyle.color=always dependency:go-offline -f src/it/dependencies/pom.xml -P protoc-3.4.0 + ./mvnw -B -V -Dstyle.color=always dependency:go-offline -f src/it/dependencies/pom.xml -P protoc-3.11.1 + ./mvnw -B -V -Dstyle.color=always dependency:go-offline -P run-its + + # These protoc executables were downloaded in the previous phase and are being referenced in toolchains.xml + chmod +x $HOME/.m2/repository/com/google/protobuf/protoc/3.4.0/protoc-3.4.0-linux-x86_64.exe + chmod +x $HOME/.m2/repository/com/google/protobuf/protoc/3.11.1/protoc-3.11.1-linux-x86_64.exe + + - name: Build and test + run: | + ./mvnw -B -V -t .github/workflows/toolschains-linux.xml -Dstyle.color=always clean verify -P run-its -Dinvoker.streamLogs=true + diff --git a/.travis/toolchains.xml b/.github/workflows/toolchains-linux.xml similarity index 76% rename from .travis/toolchains.xml rename to .github/workflows/toolchains-linux.xml index 75cdacd8..2a106aed 100644 --- a/.travis/toolchains.xml +++ b/.github/workflows/toolchains-linux.xml @@ -25,7 +25,7 @@ openjdk8 - /usr/lib/jvm/java-8-openjdk-amd64 + ${env.JAVA_HOME} @@ -34,9 +34,7 @@ 3.4.0 - - /home/travis/.m2/repository/com/google/protobuf/protoc/3.4.0/protoc-3.4.0-linux-x86_64.exe - + ${env.HOME}/.m2/repository/com/google/protobuf/protoc/3.4.0/protoc-3.4.0-linux-x86_64.exe @@ -45,9 +43,7 @@ 3.11.1 - - /home/travis/.m2/repository/com/google/protobuf/protoc/3.11.1/protoc-3.11.1-linux-x86_64.exe - + ${env.HOME}/.m2/repository/com/google/protobuf/protoc/3.11.1/protoc-3.11.1-linux-x86_64.exe diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 768ac045..00000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -dist: trusty -sudo: false - -language: java -jdk: openjdk8 - -before_install: - # Set up toolchains for java and protoc - # Protoc executables will be downloaded in the next phase - - mkdir -p $HOME/.m2 - - cp .travis/toolchains.xml $HOME/.m2/ - -install: - # Download all dependencies that integration tests might need later - - ./mvnw -B -V -Dstyle.color=always dependency:go-offline -f src/it/dependencies/pom.xml -P protoc-3.4.0 - - ./mvnw -B -V -Dstyle.color=always dependency:go-offline -f src/it/dependencies/pom.xml -P protoc-3.11.1 - - ./mvnw -B -V -Dstyle.color=always dependency:go-offline -P run-its - -before_script: - # These protoc executables were downloaded in the previous phase and are being referenced in toolchains.xml - - chmod +x $HOME/.m2/repository/com/google/protobuf/protoc/3.4.0/protoc-3.4.0-linux-x86_64.exe - - chmod +x $HOME/.m2/repository/com/google/protobuf/protoc/3.11.1/protoc-3.11.1-linux-x86_64.exe - -script: - # Finally, run the build with integration tests - - ./mvnw -B -V -Dstyle.color=always clean verify -P run-its -Dinvoker.streamLogs=true - -cache: - directories: - - $HOME/.m2