-
Notifications
You must be signed in to change notification settings - Fork 27
185 lines (171 loc) · 6.04 KB
/
build-utbot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Build UTBot and run unit tests
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
matrix-prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- id: set-matrix
name: Read config from matrix.json
run: |
TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' )
echo "matrix=$TASKS" >> $GITHUB_OUTPUT
build-utbot-and-run-unit-tests:
needs: matrix-prep
strategy:
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
runs-on: ubuntu-latest
container:
image: ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
UTBOT_ALL: /utbot_distr
UTBOT_INSTALL_DIR: /utbot_distr/install
GRPC_PATH: /utbot_distr/install
CLI_PATH: /utbot_distr/cli
DOCKER_TAG: ${{ matrix.DOCKER_TAG }}
ARTIFACT_DIR: utbot-artifact
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build UTBot
run: |
export VERSION=$(date '+%Y.%m').$GITHUB_RUN_NUMBER
export RUN_INFO=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
echo $RUN_INFO
chmod +x docker/action-scripts/build-utbot.sh
./docker/action-scripts/build-utbot.sh
- name: Run Unit Tests
run: |
chmod +x docker/action-scripts/unit-tests.sh
./docker/action-scripts/unit-tests.sh
- uses: actions/upload-artifact@v3
if: failure()
with:
name: UTBot unit tests logs
path: server/build/logs
build-utbot-and-run-integration-tests:
needs: matrix-prep
strategy:
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
runs-on: ubuntu-latest
container:
image: ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
UTBOT_ALL: /utbot_distr
UTBOT_INSTALL_DIR: /utbot_distr/install
GRPC_PATH: /utbot_distr/install
CLI_PATH: /utbot_distr/cli
DOCKER_TAG: ${{ matrix.DOCKER_TAG }}
ARTIFACT_DIR: utbot-artifact
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: build UTBot
run: |
export VERSION=$(date '+%Y.%m').$GITHUB_RUN_NUMBER
export RUN_INFO=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
chmod +x docker/action-scripts/build-clean-utbot.sh
./docker/action-scripts/build-clean-utbot.sh
- name: Run Integration Tests
run: |
chmod +x docker/action-scripts/build-vsix.sh
./docker/action-scripts/build-vsix.sh
chmod +x docker/action-scripts/integration-tests.sh
./docker/action-scripts/integration-tests.sh
# - name: Setup Java for building CLion plugin
# uses: actions/setup-java@v3
# with:
# distribution: zulu
# java-version: 11
# - name: Run CLion integration tests
# run: |
# chmod +x docker/action-scripts/runClionIntegrationTests.sh
# ./docker/action-scripts/runClionIntegrationTests.sh
# - name: Upload logs
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: test-report
# path: |
# /github/home/logs
# clion-plugin/build/reports/tests/**/*
build-utbot-and-generate-test:
needs: matrix-prep
strategy:
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
runs-on: ubuntu-latest
container:
image: ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
UTBOT_ALL: /utbot_distr
UTBOT_INSTALL_DIR: /utbot_distr/install
GRPC_PATH: /utbot_distr/install
CLI_PATH: /utbot_distr/cli
DOCKER_TAG: ${{ matrix.DOCKER_TAG }}
ARTIFACT_DIR: utbot-artifact
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build UTBot
run: |
chmod +x docker/action-scripts/build-clean-utbot.sh
./docker/action-scripts/build-clean-utbot.sh
- name: Generate tests
run: |
chmod +x docker/action-scripts/generate-tests.sh
./docker/action-scripts/generate-tests.sh
- name: Upload generated tests for next job
uses: actions/upload-artifact@v3
with:
name: project
path: ./integration-tests/c-example
build-portable-container:
needs: build-utbot-and-generate-test
runs-on: ubuntu-20.04
env:
DOCKER_IMAGE_TAG: docker-image
PORTABLE_CONTAINER_NAME: Portable
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
chmod +x docker/action-scripts/install-dependencies-for-docker-image-without-utbot.sh
./docker/action-scripts/install-dependencies-for-docker-image-without-utbot.sh
mkdir -p ./c-example
- name: Download generated test
uses: actions/download-artifact@v3
with:
name: project
path: ./c-example
- name: Display structure of downloaded files
run: ls -R
working-directory: ./c-example
- name: Check test portability
run: |
rm -r /home/runner/work/UTBotCpp/UTBotCpp/c-example/build
env make -f /home/runner/work/UTBotCpp/UTBotCpp/c-example/tests/makefiles/lib/floats/floating_point_plain.mk run GTEST_FLAGS="--gtest_filter=*.plain_isnan_test_1" CLANG="/usr/bin/clang-10" CLANGXX="/usr/bin/clang++-10" GTEST="/gtest"