|
| 1 | +name: "[M] Publish on GitHub Packages" |
| 2 | + |
| 3 | +on: workflow_dispatch |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_and_run_tests: |
| 7 | + if: ${{ github.actor == 'korifey' || github.actor == 'denis-fokin' || github.actor == 'victoriafomina' || |
| 8 | + github.actor == 'bissquit' }} |
| 9 | + runs-on: ubuntu-20.04 |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v3 |
| 12 | + - uses: actions/setup-java@v3 |
| 13 | + with: |
| 14 | + java-version: '8' |
| 15 | + distribution: 'zulu' |
| 16 | + java-package: jdk+fx |
| 17 | + cache: gradle |
| 18 | + - uses: gradle/gradle-build-action@v2 |
| 19 | + with: |
| 20 | + gradle-version: 6.8 |
| 21 | + |
| 22 | + - name: "UTBot Java: build and run tests" |
| 23 | + run: | |
| 24 | + export KOTLIN_HOME="/usr" |
| 25 | + gradle clean build --no-daemon |
| 26 | +
|
| 27 | + - name: Upload utbot-framework logs |
| 28 | + if: ${{ failure() }} |
| 29 | + uses: actions/upload-artifact@v2 |
| 30 | + with: |
| 31 | + name: utbot_framework_logs |
| 32 | + path: utbot-framework/logs/* |
| 33 | + |
| 34 | + - name: Upload utbot-framework tests report artifacts if tests have failed |
| 35 | + if: ${{ failure() }} |
| 36 | + uses: actions/upload-artifact@v2 |
| 37 | + with: |
| 38 | + name: utbot_framework_tests_report |
| 39 | + path: utbot-framework/build/reports/tests/test/* |
| 40 | + |
| 41 | + publish_framework-api_and_dependencies: |
| 42 | + needs: build_and_run_tests |
| 43 | + runs-on: ubuntu-20.04 |
| 44 | + permissions: |
| 45 | + packages: write |
| 46 | + contents: read |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v3 |
| 49 | + - uses: actions/setup-java@v3 |
| 50 | + with: |
| 51 | + java-version: '8' |
| 52 | + distribution: 'zulu' |
| 53 | + java-package: jdk+fx |
| 54 | + cache: gradle |
| 55 | + - uses: gradle/gradle-build-action@v2 |
| 56 | + with: |
| 57 | + gradle-version: 6.8 |
| 58 | + arguments: publish |
| 59 | + env: |
| 60 | + GITHUB_ACTOR: ${{ github.actor }} |
| 61 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + |
| 63 | + - name: Set project version |
| 64 | + run: |
| 65 | + echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV |
| 66 | + |
| 67 | + - name: "utbot-framework-api: build and run tests" |
| 68 | + run: | |
| 69 | + cd utbot-framework-api |
| 70 | + gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}-SNAPSHOT |
| 71 | + |
| 72 | + - name: "utbot-api: build" |
| 73 | + run: | |
| 74 | + cd utbot-api |
| 75 | + gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}-SNAPSHOT |
| 76 | + |
| 77 | + - name: "utbot-core: build" |
| 78 | + run: | |
| 79 | + cd utbot-core |
| 80 | + gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}-SNAPSHOT |
0 commit comments