diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..f70b5462 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: build +on: [ push, pull_request ] +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build Gemini + run: mvn clean compile install -Dgpg.skip + - name: Setup host name + run: echo "127.0.0.1 GITHUB_ACTIONS" | sudo tee -a /etc/hosts + - name: Setup integration test + run: | + mvn archetype:update-local-catalog + # Reading the version from the pom from https://stackoverflow.com/a/50906059 + GEMINI_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + mvn archetype:generate -DarchetypeVersion=$GEMINI_VERSION -DarchetypeCatalog=local \ + -DarchetypeGroupId=com.techempower -DarchetypeArtifactId=gemini-resin-archetype \ + -Dpackage=foo.test -DartifactId=test-artifact-id -Dversion=1.0 \ + -DmachineName=GITHUB_ACTIONS -DinteractiveMode=false + cd test-artifact-id && mvn clean compile war:war + curl -sL http://caucho.com/download/resin-4.0.63.tar.gz | tar xz --strip-components=1 + rm -rf webapps/* + cp target/test-artifact-id-1.0.war webapps/ROOT.war + - name: Run integration test + run: | + cd test-artifact-id + java -jar lib/resin.jar console & + sleep 10 + n=1; + while true; do + curl localhost:8080 && break || { + if [[ $n -lt 10 ]]; then + ((n++)) + sleep 10 + else + exit 1 + fi + } + done; + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a19dc076..00000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: java - -# https://travis-ci.community/t/error-installing-oraclejdk8-expected-feature-release-number-in-range-of-9-to-14-but-got-8/3766/6 -dist: trusty - -hosts: - - TRAVIS - -jdk: - - oraclejdk11 - -install: mvn clean compile install -Dgpg.skip - -before_script: - - mvn archetype:update-local-catalog - - > - mvn archetype:generate -DarchetypeRepository=local -DarchetypeCatalog=local - -DarchetypeGroupId=com.techempower -DarchetypeArtifactId=gemini-resin-archetype - -Dpackage=foo.test -DartifactId=test-artifact-id -Dversion=1.0 - -DmachineName=TRAVIS -DinteractiveMode=false - - cd test-artifact-id && mvn clean compile war:war - - curl -sL http://caucho.com/download/resin-4.0.63.tar.gz | tar xz --strip-components=1 - - rm -rf webapps/* - - cp target/test-artifact-id-1.0.war webapps/ROOT.war - -script: - - java -jar lib/resin.jar console & - - sleep 10 - - > - n=1; - while true; do - curl localhost:8080 && break || { - if [[ $n -lt 10 ]]; then - ((n++)) - sleep 10 - else - exit 1 - fi - } - done; diff --git a/README.md b/README.md index 79807c34..19064bc0 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gemini -![Status](https://travis-ci.org/TechEmpower/gemini.svg?branch=master) +[![Status](https://github.com/TechEmpower/gemini/workflows/build/badge.svg?branch=master&event=push)](https://github.com/TechEmpower/gemini/actions?query=workflow%3Abuild+branch%3Amaster) Gemini is a web application framework built on top of the Servlet platform.