blob: 3bc6c7f50b24af201bb0647392117b72d9430ba1 [file] [log] [blame]
- name: Run bazelisk build
shell: |
java -fullversion
{{ bazelisk_executable }} version
{{ bazelisk_executable }} build {{ bazelisk_targets }}
args:
executable: /bin/bash
chdir: "{{ zuul_work_dir }}"
- name: Run bazelisk test
when: "bazelisk_test_targets != ''"
shell: |
{{ bazelisk_executable }} test --test_output=errors --test_summary=detailed --flaky_test_attempts=3 {{ bazelisk_test_targets }}
args:
executable: /bin/bash
chdir: "{{ zuul_work_dir }}"
register: test_result
failed_when: test_result.rc not in [0, 4]
- name: Copy output to artifacts location
loop: "{{ bazelisk_artifacts }}"
command: "cp {{ item }} {{ zuul_output_dir }}/artifacts"
args:
chdir: "{{ zuul_work_dir }}"
- name: Get sha1 of artifact
loop: "{{ bazelisk_artifacts }}"
stat:
path: "{{ zuul_work_dir }}/{{ item }}"
checksum_algorithm: sha1
get_checksum: yes
register: stat
- name: Return built artifacts to Zuul
with_together:
- "{{ bazelisk_artifacts }}"
- "{{ stat.results }}"
zuul_return:
data:
zuul:
artifacts:
- name: "Build"
url: "artifacts/{{ item.0 | basename }}"
metadata:
type: java_jar
sha1: "{{ item.1.stat.checksum }}"