|
7 | 7 | pull_request: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - mvn-install-java-11: |
| 10 | + mvn-install: |
| 11 | + name: Maven Install |
11 | 12 | runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + max-parallel: 4 |
| 15 | + matrix: |
| 16 | + java-version: ['11', '17'] |
| 17 | + |
12 | 18 | steps: |
13 | | - - uses: actions/checkout@v2 |
14 | | - - name: Set up JDK 11 |
15 | | - uses: actions/setup-java@v1 |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up JDK |
| 22 | + uses: actions/setup-java@v4 |
16 | 23 | with: |
17 | | - java-version: 11 |
18 | | - - name: install |
19 | | - run: "./.ci/ci.sh install" |
| 24 | + java-version: ${{ matrix.java-version }} |
| 25 | + distribution: 'temurin' |
| 26 | + |
| 27 | + - run: "./.ci/ci.sh install" |
| 28 | + |
| 29 | +# depreacted for now since SQ removed the application ZIP files needed for the integration tests |
| 30 | +# integration-tests: |
| 31 | +# runs-on: ubuntu-latest |
| 32 | +# steps: |
| 33 | +# - uses: actions/checkout@v2 |
| 34 | +# - name: Set up JDK 11 |
| 35 | +# uses: actions/setup-java@v1 |
| 36 | +# with: |
| 37 | +# java-version: 11 |
| 38 | +# - name: run integration tests |
| 39 | +# run: "./.ci/ci.sh integration-tests" |
20 | 40 |
|
21 | | - integration-tests: |
| 41 | + nondex: |
| 42 | + name: Maven Nondex |
22 | 43 | runs-on: ubuntu-latest |
| 44 | + strategy: |
| 45 | + max-parallel: 4 |
| 46 | + matrix: |
| 47 | + java-version: ['11', '17'] |
| 48 | + |
23 | 49 | steps: |
24 | | - - uses: actions/checkout@v2 |
25 | | - - name: Set up JDK 11 |
26 | | - uses: actions/setup-java@v1 |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Set up JDK |
| 53 | + uses: actions/setup-java@v4 |
27 | 54 | with: |
28 | | - java-version: 11 |
29 | | - - name: run integration tests |
30 | | - run: "./.ci/ci.sh integration-tests" |
| 55 | + java-version: ${{ matrix.java-version }} |
| 56 | + distribution: 'temurin' |
31 | 57 |
|
32 | | - nondex: |
| 58 | + - run: "./.ci/ci.sh nondex" |
| 59 | + |
| 60 | + execute-sonarqube-plugin: |
| 61 | + name: Execute SonarQube Plugin |
33 | 62 | runs-on: ubuntu-latest |
| 63 | + |
34 | 64 | steps: |
35 | | - - uses: actions/checkout@v2 |
36 | | - - name: Set up JDK 11 |
37 | | - uses: actions/setup-java@v1 |
| 65 | + - name: Checkout code |
| 66 | + uses: actions/checkout@v4 |
| 67 | + |
| 68 | + - name: Set up JDK 17 |
| 69 | + uses: actions/setup-java@v4 |
38 | 70 | with: |
39 | | - java-version: 11 |
40 | | - - name: install |
41 | | - run: "./.ci/ci.sh nondex" |
| 71 | + java-version: '17' |
| 72 | + distribution: 'temurin' |
| 73 | + |
| 74 | + - name: Build Jar |
| 75 | + run: mvn -e --no-transfer-progress package -Pno-validations |
| 76 | + |
| 77 | + - name: Run SonarQube |
| 78 | + run: docker run -d --name sonarqube -p 9000:9000 -v ${{ github.workspace }}/repo/target/:/opt/sonarqube/extensions/plugins/ sonarqube:9.9-community |
| 79 | + - name: Check SonarQube is Up |
| 80 | + run: | |
| 81 | + while [[ ! `curl -s http://localhost:9000/api/system/status` =~ "UP" ]]; do |
| 82 | + echo "Waiting for web server to come up..." |
| 83 | + sleep 10 |
| 84 | + done |
| 85 | +
|
| 86 | + - name: Execute SonarQube analysis |
| 87 | + run: | |
| 88 | + mvn -e --no-transfer-progress sonar:sonar -Dsonar.login=admin -Dsonar.password=admin |
42 | 89 |
|
| 90 | + - name: Check logs for error |
| 91 | + run: docker logs sonarqube | grep "ERROR" || test $? = 1 |
| 92 | + |
| 93 | + - name: Cleanup |
| 94 | + run: docker stop sonarqube |
0 commit comments