From 7a4a11530ab275836e18f4a57f629354878dedd5 Mon Sep 17 00:00:00 2001 From: xushanchuan Date: Thu, 26 Nov 2020 16:05:49 +0800 Subject: [PATCH] Add github actions --- .github/workflows/gradle.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..54496dd --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,34 @@ +name: Java CI + +on: + push: + branches: + - '**' + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + pull_request: + branches: + - '**' + +jobs: + build: + + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Test with Gradle + run: ./gradlew clean test \ No newline at end of file diff --git a/README.md b/README.md index c4a2b12..2e47c7c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ![RealWorld Example App using Kotlin and Spring](example-logo.png) +[![Actions](https://github.com/gothinkster/spring-boot-realworld-example-app/workflows/Java%20CI/badge.svg)](https://github.com/gothinkster/spring-boot-realworld-example-app/actions) + > ### Spring boot + MyBatis codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld-example-apps) spec and API. This codebase was created to demonstrate a fully fledged fullstack application built with Spring boot + Mybatis including CRUD operations, authentication, routing, pagination, and more.