diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..ce242cd4 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,89 @@ +# 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 +# + + + # 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 ] + 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@v4 + with: + name: Package + path: staging \ No newline at end of file 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/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 +} 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 00000000..03c205b6 Binary files /dev/null and b/target/classes/App.class differ diff --git a/target/classes/DeepThought.class b/target/classes/DeepThought.class new file mode 100644 index 00000000..8cf5cdfe Binary files /dev/null and b/target/classes/DeepThought.class differ