|
| 1 | +name: Main Workflow |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - 'branch-*' |
| 8 | + - 'dogfood-on-*' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - master |
| 12 | + - 'branch-*' |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: Build |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + fetch-depth: 1 |
| 25 | + submodules: 'recursive' |
| 26 | + |
| 27 | + - name: Set up JDK 17 |
| 28 | + uses: actions/setup-java@v4 |
| 29 | + with: |
| 30 | + java-version: 17 |
| 31 | + distribution: 'temurin' |
| 32 | + |
| 33 | + - name: Setup Gradle |
| 34 | + uses: gradle/gradle-build-action@v3 |
| 35 | + with: |
| 36 | + gradle-version: wrapper |
| 37 | + |
| 38 | + - name: Export project version |
| 39 | + id: project_version |
| 40 | + run: | |
| 41 | + mkdir -p project-version |
| 42 | + PROJECTVERSION=$(./gradlew printVersion --console=plain -q) |
| 43 | + echo "PROJECT_VERSION=$PROJECTVERSION" >> $GITHUB_ENV |
| 44 | + echo "$PROJECTVERSION" > project-version/evaluated_project_version.txt |
| 45 | +
|
| 46 | + - name: Build |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
| 50 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 51 | + SIGN_KEY: ${{ secrets.SIGN_KEY }} |
| 52 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
| 53 | + run: | |
| 54 | + source .github/workflows/cirrus-env BUILD |
| 55 | + ./gradlew build storeProjectVersion -x test -x sonar --console=plain --no-daemon --info |
| 56 | +
|
| 57 | + - name: Upload project version |
| 58 | + uses: actions/upload-artifact@v4 |
| 59 | + with: |
| 60 | + name: project-version |
| 61 | + path: project-version/ |
| 62 | + retention-days: 1 |
| 63 | + |
| 64 | + test: |
| 65 | + name: Test |
| 66 | + needs: build |
| 67 | + runs-on: ubuntu-latest |
| 68 | + permissions: |
| 69 | + contents: read |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + with: |
| 73 | + fetch-depth: 1 |
| 74 | + submodules: 'recursive' |
| 75 | + |
| 76 | + - name: Set up JDK 17 |
| 77 | + uses: actions/setup-java@v4 |
| 78 | + with: |
| 79 | + java-version: 17 |
| 80 | + distribution: 'temurin' |
| 81 | + |
| 82 | + - name: Setup Gradle |
| 83 | + uses: gradle/gradle-build-action@v3 |
| 84 | + with: |
| 85 | + gradle-version: wrapper |
| 86 | + |
| 87 | + - name: Download project version |
| 88 | + uses: actions/download-artifact@v4 |
| 89 | + with: |
| 90 | + name: project-version |
| 91 | + path: project-version/ |
| 92 | + |
| 93 | + - name: Test and analyze |
| 94 | + env: |
| 95 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 96 | + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
| 97 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 98 | + run: | |
| 99 | + source .github/workflows/cirrus-env BUILD |
| 100 | + ./gradlew test sonar --console=plain --no-daemon --info -x artifactoryPublish |
| 101 | +
|
| 102 | + - name: Upload test results |
| 103 | + if: always() |
| 104 | + uses: actions/upload-artifact@v4 |
| 105 | + with: |
| 106 | + name: test-results |
| 107 | + path: '**/test-results/**/*.xml' |
| 108 | + |
| 109 | + windows_qa: |
| 110 | + name: Windows QA |
| 111 | + needs: build |
| 112 | + runs-on: windows-latest |
| 113 | + if: ${{ !github.event.pull_request || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v4 |
| 116 | + with: |
| 117 | + fetch-depth: 1 |
| 118 | + submodules: 'recursive' |
| 119 | + |
| 120 | + - name: Set up JDK 17 |
| 121 | + uses: actions/setup-java@v4 |
| 122 | + with: |
| 123 | + java-version: 17 |
| 124 | + distribution: 'temurin' |
| 125 | + |
| 126 | + - name: Setup Gradle |
| 127 | + uses: gradle/gradle-build-action@v3 |
| 128 | + with: |
| 129 | + gradle-version: wrapper |
| 130 | + |
| 131 | + - name: Run Windows tests |
| 132 | + env: |
| 133 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 134 | + run: | |
| 135 | + source .github/workflows/cirrus-env CI |
| 136 | + ./gradlew test --console=plain --no-daemon --info |
| 137 | +
|
| 138 | + - name: Upload test results |
| 139 | + if: always() |
| 140 | + uses: actions/upload-artifact@v4 |
| 141 | + with: |
| 142 | + name: windows-test-results |
| 143 | + path: '**/test-results/**/*.xml' |
0 commit comments