Skip to content

Commit

Permalink
[ggj][engx] fix: use a VM for CircleCI builds (#367)
Browse files Browse the repository at this point in the history
* fix: use a VM for CircleCI builds

* Update config.yml

* fix: set python version
  • Loading branch information
miraleung committed Oct 5, 2020
1 parent 3c1f069 commit 4913aec
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,46 @@ version: 2.1
# ======================= JOBS =======================
jobs:
gapic-generator-java-tests:
docker:
- image: l.gcr.io/google/bazel
working_directory: /home/circleci/project/gapic-generator-java
working_directory: /tmp/
environment:
TEST_REPORTS_DIR: /tmp/workspace/bazel/reports/gapic-generator-java
BAZEL_VERSION: 3.5.1
PYTHON_VERSION: 3.5.2
machine: true
steps:
- checkout
- checkout:
path: gapic-generator-java
- attach_workspace:
at: workspace
- run:
name: Set Python version
command: |
pyenv global ${PYTHON_VERSION}
- run:
name: Install Bazel
command: |
wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh -O bazel_installer.sh
chmod +x bazel_installer.sh
./bazel_installer.sh --user
- run:
name: Make reports directory
command: |
mkdir -p ${TEST_REPORTS_DIR}
- run:
name: Build targets
name: Build targets for gapic-generator-java
command: |
cd /tmp/gapic-generator-java
bazel --batch build //...
- run:
name: Test targets
name: Run unit tests for gapic-generator-java
command: |
cd /tmp/gapic-generator-java
bazel --batch test //... --noshow_progress
find . -type f -regex ".*/bazel-testlogs/.*xml" -exec cp {} ${TEST_REPORTS_DIR} \;
- store_test_results:
path: ~/.cache/bazel
path: bazel/reports/gapic-generator-java
- store_artifacts:
path: bazel/reports/gapic-generator-java
google-java-format:
docker:
- image: l.gcr.io/google/bazel
Expand Down

0 comments on commit 4913aec

Please sign in to comment.