Skip to content

Commit 95cd0f5

Browse files
miraleungsummer-ji-eng
authored andcommitted
[ggj][engx] fix: use a VM for CircleCI builds (#367)
* fix: use a VM for CircleCI builds * Update config.yml * fix: set python version
1 parent 05d9c9e commit 95cd0f5

1 file changed

Lines changed: 32 additions & 7 deletions

File tree

.circleci/config.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,46 @@ version: 2.1
33
# ======================= JOBS =======================
44
jobs:
55
gapic-generator-java-tests:
6-
docker:
7-
- image: l.gcr.io/google/bazel
8-
working_directory: /home/circleci/project/gapic-generator-java
6+
working_directory: /tmp/
7+
environment:
8+
TEST_REPORTS_DIR: /tmp/workspace/bazel/reports/gapic-generator-java
9+
BAZEL_VERSION: 3.5.1
10+
PYTHON_VERSION: 3.5.2
11+
machine: true
912
steps:
10-
- checkout
13+
- checkout:
14+
path: gapic-generator-java
15+
- attach_workspace:
16+
at: workspace
17+
- run:
18+
name: Set Python version
19+
command: |
20+
pyenv global ${PYTHON_VERSION}
21+
- run:
22+
name: Install Bazel
23+
command: |
24+
wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh -O bazel_installer.sh
25+
chmod +x bazel_installer.sh
26+
./bazel_installer.sh --user
27+
- run:
28+
name: Make reports directory
29+
command: |
30+
mkdir -p ${TEST_REPORTS_DIR}
1131
- run:
12-
name: Build targets
32+
name: Build targets for gapic-generator-java
1333
command: |
34+
cd /tmp/gapic-generator-java
1435
bazel --batch build //...
1536
- run:
16-
name: Test targets
37+
name: Run unit tests for gapic-generator-java
1738
command: |
39+
cd /tmp/gapic-generator-java
1840
bazel --batch test //... --noshow_progress
41+
find . -type f -regex ".*/bazel-testlogs/.*xml" -exec cp {} ${TEST_REPORTS_DIR} \;
1942
- store_test_results:
20-
path: ~/.cache/bazel
43+
path: bazel/reports/gapic-generator-java
44+
- store_artifacts:
45+
path: bazel/reports/gapic-generator-java
2146
google-java-format:
2247
docker:
2348
- image: l.gcr.io/google/bazel

0 commit comments

Comments
 (0)