From b24bc91963e4210315f0bc1f8a0f70030d6d7ff7 Mon Sep 17 00:00:00 2001 From: Du Yuanchao Date: Mon, 2 Nov 2020 12:16:05 +0800 Subject: [PATCH 1/2] remove target files --- .github/workflows/checkstyle.yml | 2 +- .../java/com/examplehub/basics/ForLoop.java | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index f1a4dc45..1e574e0b 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -3,7 +3,7 @@ name: Code Formatter on: [push] jobs: - lint: + checkstyle: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/src/main/java/com/examplehub/basics/ForLoop.java b/src/main/java/com/examplehub/basics/ForLoop.java index 7a106b48..9f299b41 100644 --- a/src/main/java/com/examplehub/basics/ForLoop.java +++ b/src/main/java/com/examplehub/basics/ForLoop.java @@ -66,6 +66,32 @@ public static void main(String[] args) { } System.out.println("\n"); + /* + * 1 2 3 4 5 + */ + int x = 0; + while (true) { + x++; + System.out.print(x + ""); + if (x == 5) { + break; + } + } + System.out.println(); + + /* + * 1 2 3 4 5 + */ + int i = 0; + do { + i++; + System.out.print(i + ""); + if (i == 5) { + break; + } + } while (true); + System.out.println(); + /* infinite loop */ /* for (; ; ) { From 81ec1514ff5a0992653e3e4f47d0dc6c09e5d09c Mon Sep 17 00:00:00 2001 From: shellhub Date: Mon, 2 Nov 2020 18:58:45 +0800 Subject: [PATCH 2/2] run actions on pull_request --- .github/workflows/checkstyle.yml | 2 +- .github/workflows/gradle.yml | 2 +- .github/workflows/maven.yml | 2 +- .gitignore | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 1e574e0b..383838e1 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -1,6 +1,6 @@ name: Code Formatter -on: [push] +on: [push, pull_request] jobs: checkstyle: diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1418aa04..4e646fd0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -3,7 +3,7 @@ name: Java CI with Gradle -on: [push] +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 967af3e5..63712cfe 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -3,7 +3,7 @@ name: Java CI with Maven -on: [push] +on: [push, pull_request] jobs: build: diff --git a/.gitignore b/.gitignore index 85543c50..5f62faa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .gradle /build/ .idea/ +target # Ignore Gradle GUI config gradle-app.setting