Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame^] | 1 | - name: Place for new version of sources |
| 2 | file: |
| 3 | path: "{{ new_source_prefix }}" |
| 4 | state: directory |
| 5 | |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 6 | - name: Prepare copy of the new version of sources |
Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame^] | 7 | command: git worktree add {{ new_source_prefix }}/{{ zuul.project.short_name }} {{ zuul.branch }} |
| 8 | args: |
| 9 | chdir: "{{ zuul.project.src_dir }}" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 10 | |
| 11 | - name: Retrieve coverage from parent jobs |
| 12 | get_url: |
| 13 | url: "{{ item.url }}" |
Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame^] | 14 | dest: "{{ new_source_prefix }}/coverage.xml" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 15 | when: |
| 16 | - item.metadata is defined |
| 17 | - item.metadata.type is defined |
| 18 | - item.metadata.type == "cobertura_xml" |
| 19 | loop: "{{ zuul.artifacts }}" |
| 20 | |
| 21 | - name: Generate pycobertura report |
| 22 | shell: | |
| 23 | set -ex |
| 24 | PATH=${PATH}:~/.local/bin |
| 25 | pycobertura show --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage.html" \ |
Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame^] | 26 | --source "{{ new_source_prefix }}/{{ zuul.project.short_name }}" "{{ new_source_prefix }}/coverage.xml" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 27 | pycobertura diff --format html --output "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html" \ |
| 28 | --source1 "{{ zuul.project.src_dir }}" "{{ coverage_xml_dir }}/coverage.xml" \ |
Jan Kundrát | 6700809 | 2020-04-08 19:06:12 +0200 | [diff] [blame^] | 29 | --source2 "{{ new_source_prefix }}/{{ zuul.project.short_name }}" "{{ new_source_prefix }}/coverage.xml" |
Jan Kundrát | 3a01643 | 2020-04-07 22:47:49 +0200 | [diff] [blame] | 30 | sed -e 's;^ </body>$; <p>Show <a href="coverage.html">final coverage</a> only</p>\n </body>;' \ |
| 31 | -i "{{ ansible_user_dir }}/zuul-output/logs/coverage-diff.html" |