diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml new file mode 100644 index 0000000..4d77eb4 --- /dev/null +++ b/.github/workflows/demo.yml @@ -0,0 +1,14 @@ +name: maven pipeline + +on: + pull_request: + branches: + - dev +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: get the code + uses: actions/checkout@v4 + - name: packing + run: mvn package \ No newline at end of file diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml deleted file mode 100644 index 9827cb3..0000000 --- a/.github/workflows/manual.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- - -name: manual-workflow - -on: - workflow_dispatch: - - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: print context info - run: | - echo "${{ toJson(github) }}" - echo "${{ toJson(vars) }}" - if: github.ref == 'refs/heads/main' - - - name: get the code - uses: actions/checkout@v6 - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: java - if: github.ref != 'refs/heads/main' - - name: package the code - run: mvn --batch-mode -Dmaven.test.failure.ignore=true test - - name: Perform code quality analysis - uses: github/codeql-action/analyze@v4 - if: github.ref != 'refs/heads/main' - - name: publish test results - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - files: "**/target/surefire-reports/**/*.xml" - comment_mode: always \ No newline at end of file diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml deleted file mode 100644 index 254cbd5..0000000 --- a/.github/workflows/pr.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- - -name: pull-request-workflow - -on: - pull_request: - branches: - - dev - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: get the code - uses: actions/checkout@v6 - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: java - - name: package the code - run: mvn --batch-mode -Dmaven.test.failure.ignore=true test - - name: Perform code quality analysis - uses: github/codeql-action/analyze@v4 - - name: publish test results - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - files: "**/target/surefire-reports/**/*.xml" - comment_mode: always \ No newline at end of file diff --git a/pom.xml b/pom.xml index 45bc48d..7375c50 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,9 @@ 1.0-SNAPSHOT my-java-app http://maven.apache.org + + dummyrepos + junit diff --git a/src/main/java/com/example/App.java b/src/main/java/com/example/App.java index 4d6bcd0..1827cc4 100644 --- a/src/main/java/com/example/App.java +++ b/src/main/java/com/example/App.java @@ -9,6 +9,6 @@ public class App public static void main( String[] args ) { System.out.println("Hello World!"); - System.out.println( "Hello World!" ); + System.out.println( "welcome to git" ); } } diff --git a/src/test/java/com/example/AppTest.java b/src/test/java/com/example/AppTest.java index e85c480..d47a507 100644 --- a/src/test/java/com/example/AppTest.java +++ b/src/test/java/com/example/AppTest.java @@ -41,6 +41,6 @@ public void testApp() */ public void testAppOther() { - assertTrue( true ); + assertTrue( false ); } }