|
1 |
| -name: "UTBot Java: build and run tests" |
| 1 | +name: "[M] UTBot Java: build and run tests" |
2 | 2 |
|
3 | 3 | on:
|
| 4 | + workflow_dispatch: |
| 5 | + |
4 | 6 | push:
|
5 | 7 | branches: [main]
|
6 | 8 | pull_request:
|
|
42 | 44 | chmod +x ./scripts/monitoring.sh
|
43 | 45 | ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
|
44 | 46 | - name: Run tests
|
45 |
| - run: | |
| 47 | + run: | |
46 | 48 | gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }}
|
47 | 49 |
|
48 | 50 | - name: Upload logs
|
@@ -87,78 +89,15 @@ jobs:
|
87 | 89 | echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
|
88 | 90 | chmod +x ./scripts/monitoring.sh
|
89 | 91 | ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
|
| 92 | +
|
90 | 93 | - name: Run tests
|
91 | 94 | run: |
|
92 | 95 | cd ${{ matrix.project }}
|
93 | 96 | gradle build --no-daemon
|
| 97 | +
|
94 | 98 | - name: Upload test report if tests have failed
|
95 | 99 | if: ${{ failure() }}
|
96 | 100 | uses: actions/upload-artifact@v3
|
97 | 101 | with:
|
98 | 102 | name: test_report ${{ matrix.project }}
|
99 | 103 | path: ${{ matrix.project }}/build/reports/tests/test/*
|
100 |
| - |
101 |
| - publish-cli-image: |
102 |
| - needs: framework |
103 |
| - if: ${{ github.event_name == 'push' }} |
104 |
| - runs-on: ubuntu-20.04 |
105 |
| - container: unittestbot/java-env:java11-zulu-jdk-fx-gradle7.4.2-kotlinc1.7.0 |
106 |
| - steps: |
107 |
| - - uses: actions/checkout@v3 |
108 |
| - |
109 |
| - - name: Set environment variables |
110 |
| - run: | |
111 |
| - echo COMMIT_SHORT_SHA="$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
112 |
| - echo VERSION="$(date +%Y).$(date +%-m)" >> $GITHUB_ENV |
113 |
| - |
114 |
| - - name: Build UTBot Java CLI |
115 |
| - run: | |
116 |
| - cd utbot-cli |
117 |
| - gradle build --no-daemon -x test -PsemVer=${{ env.VERSION }} |
118 |
| - - name: Set docker tag |
119 |
| - run: |
120 |
| - echo DOCKER_TAG="$(date +%Y).$(date +%-m).$(date +%-d)-${{ env.COMMIT_SHORT_SHA }}" >> $GITHUB_ENV |
121 |
| - |
122 |
| - - name: Log in to the Container registry |
123 |
| - uses: docker/login-action@v2 |
124 |
| - with: |
125 |
| - registry: ${{ env.REGISTRY }} |
126 |
| - username: ${{ github.actor }} |
127 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
128 |
| - |
129 |
| - - name: Set up Docker Buildx |
130 |
| - uses: docker/setup-buildx-action@v2 |
131 |
| - |
132 |
| - - name: Cache Docker layers |
133 |
| - uses: actions/cache@v3 |
134 |
| - with: |
135 |
| - path: /tmp/.buildx-cache |
136 |
| - key: ${{ runner.os }}-buildx-${{ github.sha }} |
137 |
| - restore-keys: | |
138 |
| - ${{ runner.os }}-buildx- |
139 |
| -
|
140 |
| - - name: Docker meta |
141 |
| - id: meta |
142 |
| - uses: docker/metadata-action@v3 |
143 |
| - with: |
144 |
| - images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }} |
145 |
| - tags: | |
146 |
| - type=raw,value=${{ env.DOCKER_TAG }} |
147 |
| -
|
148 |
| - - name: Docker Buildx (build and push) |
149 |
| - run: | |
150 |
| - docker buildx build \ |
151 |
| - -f ${{ env.DOCKERFILE_PATH }} \ |
152 |
| - --cache-from "type=local,src=/tmp/.buildx-cache" \ |
153 |
| - --cache-to "type=local,dest=/tmp/.buildx-cache-new" \ |
154 |
| - --tag ${{ steps.meta.outputs.tags }} \ |
155 |
| - --build-arg UTBOT_JAVA_CLI=utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar \ |
156 |
| - --push . |
157 |
| - # Temp fix |
158 |
| - # https://github.com/docker/build-push-action/issues/252 |
159 |
| - # https://github.com/moby/buildkit/issues/1896 |
160 |
| - |
161 |
| - - name: Move cache |
162 |
| - run: | |
163 |
| - rm -rf /tmp/.buildx-cache |
164 |
| - mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
0 commit comments