diff --git a/.circleci/config.yml b/.circleci/config.yml index cfee57f5a4..5a5afd7c9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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