|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: Main Branch Quality Check |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - main |
| 24 | + |
| 25 | +jobs: |
| 26 | + build: |
| 27 | + name: Main Build |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v3 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + |
| 34 | + - name: Set up JDK11 |
| 35 | + uses: actions/setup-java@v3 |
| 36 | + with: |
| 37 | + distribution: 'temurin' |
| 38 | + java-version: '11' |
| 39 | + cache: 'maven' |
| 40 | + |
| 41 | + - name: Cache SonarCloud packages |
| 42 | + uses: actions/cache@v3 |
| 43 | + with: |
| 44 | + path: ~/.sonar/cache |
| 45 | + key: ${{ runner.os }}-sonar |
| 46 | + restore-keys: ${{ runner.os }}-sonar |
| 47 | + |
| 48 | + - name: Cache local Maven repository |
| 49 | + uses: actions/cache@v3 |
| 50 | + with: |
| 51 | + path: ~/.m2/repository |
| 52 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 53 | + restore-keys: | |
| 54 | + ${{ runner.os }}-m2 |
| 55 | +
|
| 56 | + - name: Run Tests with Coverage |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 60 | + run: | |
| 61 | + git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss |
| 62 | + cd nonoss && bash -x install-non-oss.sh && cd .. |
| 63 | + mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack |
0 commit comments