From cb975b41f3da1206ef4269c2d45c195da3916ecd Mon Sep 17 00:00:00 2001 From: Farah Mango <90278013+farahmango@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:09:54 +0300 Subject: [PATCH 01/12] Create main.yml --- .github/workflows/main.yml | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..57d0ed8c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,69 @@ +name: Maven CI/CD + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build_and_test: + runs-on: ubuntu-latest + + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + + - name: Cache the Maven packages to speed up build + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build and test project with Maven + run: mvn -B package --file pom.xml + + + publish-job: + runs-on: ubuntu-latest + needs: [build_and_test] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 14 + - run: mvn -B package --file pom.xml -DskipTests + - run: mkdir staging && cp target/*jar-with-dependencies.jar staging + - uses: actions/upload-artifact@v1 + with: + name: Package + path: staging + + build-docker-image: + name: Publish to Docker Hub + runs-on: ubuntu-latest + needs: [build_and_test] + + steps: + - uses: actions/checkout@v2 + - name: Login to Docker Hub + run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + - name: Build Container image + run: docker build -t ${{ secrets.DOCKER_REPO }}:latest . + - name: Publish Docker image + run: docker push ${{ secrets.DOCKER_REPO }} From 81209bd712a34e7f75eedadcccbd95c0aa602674 Mon Sep 17 00:00:00 2001 From: Farah Mango <90278013+farahmango@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:37:44 +0300 Subject: [PATCH 02/12] Update App.java --- src/main/java/App.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/App.java b/src/main/java/App.java index 6f9d5aab..68c1141d 100644 --- a/src/main/java/App.java +++ b/src/main/java/App.java @@ -7,5 +7,6 @@ public static void main( String[] args ) DeepThought ourSuperComputer = new DeepThought(); int ans = ourSuperComputer.answer_to_the_ultimate_question_of_life_the_universe_and_everything(); System.out.println(ans); + // } -} \ No newline at end of file +} From 433ab96bfdfad236156884c214e84bb20ca1558e Mon Sep 17 00:00:00 2001 From: Farah Mango <90278013+farahmango@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:46:23 +0300 Subject: [PATCH 03/12] Update main.yml --- .github/workflows/main.yml | 69 ++++++-------------------------------- 1 file changed, 11 insertions(+), 58 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57d0ed8c..50112318 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,69 +1,22 @@ -name: Maven CI/CD +name: Java CI with Maven on: push: - branches: [ master ] + branches: [ "main" ] pull_request: - branches: [ master ] + branches: [ "main" ] jobs: - build_and_test: + build: runs-on: ubuntu-latest - services: - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 14 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 14 - - - name: Cache the Maven packages to speed up build - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Build and test project with Maven + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven run: mvn -B package --file pom.xml - - - publish-job: - runs-on: ubuntu-latest - needs: [build_and_test] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 14 - - run: mvn -B package --file pom.xml -DskipTests - - run: mkdir staging && cp target/*jar-with-dependencies.jar staging - - uses: actions/upload-artifact@v1 - with: - name: Package - path: staging - - build-docker-image: - name: Publish to Docker Hub - runs-on: ubuntu-latest - needs: [build_and_test] - - steps: - - uses: actions/checkout@v2 - - name: Login to Docker Hub - run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - - name: Build Container image - run: docker build -t ${{ secrets.DOCKER_REPO }}:latest . - - name: Publish Docker image - run: docker push ${{ secrets.DOCKER_REPO }} From 51c575df5fd3358a5a5345e2d8d531acb6a9e08d Mon Sep 17 00:00:00 2001 From: Farah Mango <90278013+farahmango@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:47:47 +0300 Subject: [PATCH 04/12] Update main.yml From e797989f74dc22b00ed6fd55a13f97f99596a267 Mon Sep 17 00:00:00 2001 From: FarahMango Date: Tue, 3 Dec 2024 11:51:05 +0300 Subject: [PATCH 05/12] ff --- .github/workflows/main.yml | 73 +++++++------------------------------- 1 file changed, 13 insertions(+), 60 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57d0ed8c..7744e08d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,69 +1,22 @@ -name: Maven CI/CD +name: Java CI with Maven on: push: - branches: [ master ] + branches: [ "main" ] pull_request: - branches: [ master ] + branches: [ "main" ] jobs: - build_and_test: + build: runs-on: ubuntu-latest - services: - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - - - name: Cache the Maven packages to speed up build - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Build and test project with Maven - run: mvn -B package --file pom.xml - - - publish-job: - runs-on: ubuntu-latest - needs: [build_and_test] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 14 - - run: mvn -B package --file pom.xml -DskipTests - - run: mkdir staging && cp target/*jar-with-dependencies.jar staging - - uses: actions/upload-artifact@v1 - with: - name: Package - path: staging - - build-docker-image: - name: Publish to Docker Hub - runs-on: ubuntu-latest - needs: [build_and_test] - - steps: - - uses: actions/checkout@v2 - - name: Login to Docker Hub - run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - - name: Build Container image - run: docker build -t ${{ secrets.DOCKER_REPO }}:latest . - - name: Publish Docker image - run: docker push ${{ secrets.DOCKER_REPO }} + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml \ No newline at end of file From ea659e23dc89aae224c78f08a12040c9c3129495 Mon Sep 17 00:00:00 2001 From: Farah Mango <90278013+farahmango@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:54:05 +0300 Subject: [PATCH 06/12] Create maven.yml --- .github/workflows/maven.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..c6bb0365 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,35 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 From 65bbc3bd7d0c30daec905232bc6df9f1e16f0e6b Mon Sep 17 00:00:00 2001 From: FarahMango Date: Wed, 4 Dec 2024 09:56:47 +0300 Subject: [PATCH 07/12] updates --- .idea/.gitignore | 3 +++ .idea/compiler.xml | 13 +++++++++++++ .idea/encodings.xml | 7 +++++++ .idea/jarRepositories.xml | 20 ++++++++++++++++++++ .idea/misc.xml | 12 ++++++++++++ .idea/vcs.xml | 6 ++++++ src/main/java/DeepThought.java | 2 +- target/classes/App.class | Bin 0 -> 758 bytes target/classes/DeepThought.class | Bin 0 -> 1682 bytes 9 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 target/classes/App.class create mode 100644 target/classes/DeepThought.class diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..a4cee84f --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..aa00ffab --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 00000000..712ab9d9 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..d31b37ac --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/DeepThought.java b/src/main/java/DeepThought.java index 148fba97..ae452536 100644 --- a/src/main/java/DeepThought.java +++ b/src/main/java/DeepThought.java @@ -19,7 +19,7 @@ private void calculate(){ } System.out.println("7.5 million years have now passed and I have a answer"); } - +//comment private void think(int time){ try { TimeUnit.SECONDS.sleep(time); diff --git a/target/classes/App.class b/target/classes/App.class new file mode 100644 index 0000000000000000000000000000000000000000..76fbca7d0fb502d6f950dfbc1a719698713b2f0d GIT binary patch literal 758 zcmZuv+ip@p6kWrm2PkL-!5h_6>jhdZCO%e848{aQ)P#n__;51NDNH>#4|Ce^S^7W| zP5b~q%D4thYLm{x?3uOKUi&ih`_GSG0G{Jn2_-a(*u>oe?v>zT%fbB;@@U#^+aeDf zJaq6#VC{ttwRt6wZMBC2xo&i*1g`dVsNSc+NF@hy1!GYAFK%@1!e=JXA$Cu%xGcbt`C;LlrnM_EpUE&tlh|*+`#wzJXL7WStxhaM2Se4agp=x7wCgVD>$mu#9z-9Xu|hg|@(U&y|5YC)1UuY8C~` zeMgon=5FFgs=J;)%fef4Rzdiam>Wn3U?Q?!2K7qhmET7ofp>W>i3Kl+saO zb+4n&N49P_03`#KUt4Nigaw?~l6=ms-nx8jUABFy63;}QnJO>!jSi$y-q%#kY!hB| zAu2!Z3*&M@NB6hU<21^i>RVT#0Gz%SeAD4J2KVm0=b{ae>%fje|G`rCBfzbg>%sc qMXXQ(4#f(nQ>@9VY!Y`RgzH2>Zv_q9V46C4H*srO^=*1GxbqhjR;Hl< literal 0 HcmV?d00001 diff --git a/target/classes/DeepThought.class b/target/classes/DeepThought.class new file mode 100644 index 0000000000000000000000000000000000000000..8cf5cdfea43dad42a04838d86b8a26a64212fc1e GIT binary patch literal 1682 zcmaJ>%TgOh6g@2oMiN7e#Vb5)cb>)=q$D!w-C;$zd_GR-Gu`qL~v%V8NSc{ZP0xNQKwu<)gY zuLK5H9M1`E3#8|+JrT&P`VB2`q3n2iD{R$tXGhgsMha!WuG}Z84$sGU|C>QdEGFTQT z8dc5V5kbAZh|q>Wj#cZS%XHRhIj(E+kF@HruHgJ|B~bPKP1Q~)4VdhG3Ypt5dIZzP z%g@w-D!IzrE3JQD*KNarG&7{d>7hLmV0A-TAYbvrPF>%1jOdX*T}1<8V*-;F?$}tx zn!vYD{ZKa5ftISfuN#tTWeg+(Kl*x{XqS%??b6?sWoloDrxWoDOl!#X6ZIC>ZQRAz z0^1wX(+1k$QJGZout{=K)%-AEOa;>S2v_%8TGr@=RC~(tB!9PxOER%cMwS(eMH^Qz zX=4tT1tw2@sRSLGekXL?hVIz72U>gSY;r8Lt-4*^h=A_lzKsVc+js}>3M`!~7iW0> zp^UR4ksFC&iBT3dZERuN#zQ<37(JzQvQ@^3Z@5o=o58I)UASF)rt86(Q01r_=oZfq zJvuo6j$e96l>xPC)#3q&i=7P%SZ%Y&^_Vx;cXDEfmd&9WRPDC*8UnLCWapM7CK7+~ z-}3)weKzppDgtA3=YffMDN-EVPA!GUh_5>W{zx4|zW6%QOfE*vRJVr1?Ms^?g zR05tdCp!WE3F(N)QhH@(B>OY268tx0pB^JO(?h;6)Pvo_u&I_g#v4Bf@%-;U4S@>` z88zuh%`{bjC9}9lBMNw*;{}$#NlT2n2^L9V9+I<0%Thw+ZH{wDy+TU-g=<{G3z9H9 zBy^h7V=pl>^J5PepJQl~l^1##eG!3Vsj!d`n4s&lhy-RCou=*?jM79?Tyl*K3-6JZ wF?}p4ZbnxlLWYKg)B_6zcIM6}Bo^5lzUh(qQ Date: Wed, 4 Dec 2024 10:01:30 +0300 Subject: [PATCH 08/12] updates --- .github/workflows/main.yml | 22 ---------------------- target/classes/App.class | Bin 758 -> 758 bytes 2 files changed, 22 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 2a4bc581..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Java CI with Maven - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - name: Build with Maven - run: mvn -B package --file pom.xml diff --git a/target/classes/App.class b/target/classes/App.class index 76fbca7d0fb502d6f950dfbc1a719698713b2f0d..03c205b68f699c32d6b744a8a3b32bf7fc5bd896 100644 GIT binary patch delta 13 Ucmeyy`i*tNQ6@(2$;X%s04V?k1poj5 delta 13 Ucmeyy`i*tNQ6@&N$;X%s04Vzf1ONa4 From 0e2bccc0e38c1cbb87518ae3fff25458580ae695 Mon Sep 17 00:00:00 2001 From: FarahMango Date: Wed, 4 Dec 2024 10:03:29 +0300 Subject: [PATCH 09/12] updates --- .github/workflows/maven.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c6bb0365..28570b74 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -31,5 +31,4 @@ jobs: run: mvn -B package --file pom.xml # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 + \ No newline at end of file From 17ad7584f7b0f7a6d7cb71372b5fb498887c480a Mon Sep 17 00:00:00 2001 From: FarahMango Date: Wed, 4 Dec 2024 10:34:35 +0300 Subject: [PATCH 10/12] updates --- .github/workflows/maven.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 28570b74..0e7bccb6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -27,8 +27,16 @@ jobs: java-version: '17' distribution: 'temurin' cache: maven + - name: Build with Maven run: mvn -B package --file pom.xml + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Test Results + path: ${{ github.workspace }}/target/surefire-reports/TEST-TestSuite.xml + reporter: java-junit + java-version: 11 # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - \ No newline at end of file From 3dc50c2c688ac5dae2707e3f14d04667d4dfede8 Mon Sep 17 00:00:00 2001 From: FarahMango Date: Wed, 4 Dec 2024 11:38:08 +0300 Subject: [PATCH 11/12] updates --- .github/workflows/maven.yml | 95 +++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 24 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0e7bccb6..983ab978 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,38 +5,85 @@ # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. +# +#name: Java CI with Maven +# +#on: +# push: +# branches: [ "master" ] +# pull_request: +# branches: [ "master" ] +# +#jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Set up JDK 17 +# uses: actions/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'temurin' +# cache: maven +# -name: Java CI with Maven + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + + + +name: Maven CI/CD on: push: - branches: [ "master" ] + branches: [ master ] pull_request: - branches: [ "master" ] + branches: [ master ] jobs: - build: - + build_and_test: runs-on: ubuntu-latest + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - - name: Build with Maven - run: mvn -B package --file pom.xml - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() - with: - name: Test Results - path: ${{ github.workspace }}/target/surefire-reports/TEST-TestSuite.xml - reporter: java-junit - java-version: 11 + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Cache the Maven packages to speed up build + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build and test project with Maven + run: mvn -B package --file pom.xml + + + publish-job: + runs-on: ubuntu-latest + needs: [build_and_test] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 14 + - run: mvn -B package --file pom.xml -DskipTests + - run: mkdir staging && cp target/*jar-with-dependencies.jar staging + - uses: actions/upload-artifact@v1 + with: + name: Package + path: staging \ No newline at end of file From b74b3747a5e22a8f054f2d97feae42629c878920 Mon Sep 17 00:00:00 2001 From: FarahMango Date: Wed, 4 Dec 2024 11:41:12 +0300 Subject: [PATCH 12/12] updates --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 983ab978..ce242cd4 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -83,7 +83,7 @@ jobs: java-version: 14 - run: mvn -B package --file pom.xml -DskipTests - run: mkdir staging && cp target/*jar-with-dependencies.jar staging - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: Package path: staging \ No newline at end of file