|
| 1 | +name: Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, 'patch*' ] |
| 6 | + tags: [ '*' ] |
| 7 | + pull_request: |
| 8 | + branches: [ '*' ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Set up JDK 17 |
| 17 | + uses: actions/setup-java@v4 |
| 18 | + with: |
| 19 | + java-version: '17' |
| 20 | + distribution: 'temurin' |
| 21 | + |
| 22 | + - name: Setup Gradle |
| 23 | + uses: gradle/actions/setup-gradle@v4 |
| 24 | + |
| 25 | + - name: Build |
| 26 | + run: ./gradlew classes |
| 27 | + |
| 28 | + - name: Cache build artifacts |
| 29 | + uses: actions/cache@v4 |
| 30 | + with: |
| 31 | + path: | |
| 32 | + */build |
| 33 | + key: ${{ github.ref_name }}-build-${{ github.sha }} |
| 34 | + |
| 35 | + test: |
| 36 | + needs: build |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Set up JDK 17 |
| 42 | + uses: actions/setup-java@v4 |
| 43 | + with: |
| 44 | + java-version: '17' |
| 45 | + distribution: 'temurin' |
| 46 | + |
| 47 | + - name: Setup Gradle |
| 48 | + uses: gradle/actions/setup-gradle@v4 |
| 49 | + |
| 50 | + - name: Restore build artifacts |
| 51 | + uses: actions/cache@v4 |
| 52 | + with: |
| 53 | + path: | |
| 54 | + */build |
| 55 | + key: ${{ github.ref_name }}-build-${{ github.sha }} |
| 56 | + |
| 57 | + - name: Run tests |
| 58 | + run: ./gradlew --continue check koverXmlReport |
| 59 | + |
| 60 | + - name: Publish Test Report |
| 61 | + uses: mikepenz/action-junit-report@v5 |
| 62 | + if: always() |
| 63 | + with: |
| 64 | + report_paths: | |
| 65 | + reactive/api/build/test-results/test/TEST-*.xml |
| 66 | + reactive/core/build/test-results/test/TEST-*.xml |
| 67 | + reactive/java-flow/build/test-results/test/TEST-*.xml |
| 68 | + reactive/kotlin/build/test-results/test/TEST-*.xml |
| 69 | + reactive/reactivestreams/build/test-results/test/TEST-*.xml |
| 70 | + spring/build/test-results/test/TEST-*.xml |
| 71 | + util/build/test-results/test/TEST-*.xml |
| 72 | +
|
| 73 | + - name: Upload coverage reports |
| 74 | + uses: codecov/codecov-action@v5 |
| 75 | + with: |
| 76 | + files: build/reports/kover/report.xml |
| 77 | + fail_ci_if_error: false |
| 78 | + |
| 79 | + docs: |
| 80 | + needs: build |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + |
| 85 | + - name: Set up JDK 17 |
| 86 | + uses: actions/setup-java@v4 |
| 87 | + with: |
| 88 | + java-version: '17' |
| 89 | + distribution: 'temurin' |
| 90 | + |
| 91 | + - name: Setup Gradle |
| 92 | + uses: gradle/actions/setup-gradle@v4 |
| 93 | + |
| 94 | + - name: Restore build artifacts |
| 95 | + uses: actions/cache@v4 |
| 96 | + with: |
| 97 | + path: | |
| 98 | + */build |
| 99 | + key: ${{ github.ref_name }}-build-${{ github.sha }} |
| 100 | + |
| 101 | + - name: Generate documentation |
| 102 | + run: ./gradlew dokkaGenerate |
| 103 | + |
| 104 | + - name: Upload documentation |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: documentation |
| 108 | + path: docs/build/dokka/html |
| 109 | + |
| 110 | + pages: |
| 111 | + needs: docs |
| 112 | + runs-on: ubuntu-latest |
| 113 | + if: github.ref == 'refs/heads/main' |
| 114 | + permissions: |
| 115 | + pages: write |
| 116 | + id-token: write |
| 117 | + environment: |
| 118 | + name: github-pages |
| 119 | + url: ${{ steps.deployment.outputs.page_url }} |
| 120 | + steps: |
| 121 | + - uses: actions/checkout@v4 |
| 122 | + |
| 123 | + - name: Download documentation |
| 124 | + uses: actions/download-artifact@v4 |
| 125 | + with: |
| 126 | + name: documentation |
| 127 | + path: docs/build/dokka/html |
| 128 | + |
| 129 | + - name: Setup GitHub Pages |
| 130 | + uses: actions/configure-pages@v5 |
| 131 | + |
| 132 | + - name: Upload artifact |
| 133 | + uses: actions/upload-pages-artifact@v3 |
| 134 | + with: |
| 135 | + path: 'docs/build/dokka/html' |
| 136 | + |
| 137 | + - name: Deploy to GitHub Pages |
| 138 | + id: deployment |
| 139 | + uses: actions/deploy-pages@v4 |
| 140 | + |
| 141 | + publish: |
| 142 | + needs: test |
| 143 | + runs-on: ubuntu-latest |
| 144 | + if: startsWith(github.ref, 'refs/tags/') |
| 145 | + steps: |
| 146 | + - uses: actions/checkout@v4 |
| 147 | + |
| 148 | + - name: Set up JDK 17 |
| 149 | + uses: actions/setup-java@v4 |
| 150 | + with: |
| 151 | + java-version: '17' |
| 152 | + distribution: 'temurin' |
| 153 | + |
| 154 | + - name: Setup Gradle |
| 155 | + uses: gradle/actions/setup-gradle@v4 |
| 156 | + |
| 157 | + - name: Publish libraries |
| 158 | + run: ./gradlew publish |
| 159 | + env: |
| 160 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments