Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

ci: comment compare #1782

Merged
merged 9 commits into from
Nov 16, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions .github/workflows/test262.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -50,7 +51,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -73,4 +75,49 @@ jobs:
with:
name: new_results
- name: Compare results on ${{ matrix.os }}
run: cargo xtask compare ./base_results.json ./new_results.json --markdown
if: github.event_name == 'pull_request'
id: comparison
shell: bash
run: |
comment="$(cargo xtask compare ./base_results.json ./new_results.json --markdown)"
comment="${comment//'%'/'%25'}"
comment="${comment//$'\n'/'%0A'}"
comment="${comment//$'\r'/'%0D'}"
echo "::set-output name=comment::$comment"

- name: Get the PR number
if: github.event_name == 'pull_request'
id: pr-number
uses: kkak10/pr-number-action@v1.3

- name: Find Previous Comment
if: github.event_name == 'pull_request'
uses: peter-evans/find-comment@v1.3.0
id: previous-comment
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body-includes: Test262 conformance changes

- name: Update comment
if: github.event_name == 'pull_request' && steps.previous-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v1.4.5
continue-on-error: true
with:
comment-id: ${{ steps.previous-comment.outputs.comment-id }}
body: |
### Test262 coverage results

${{ steps.comparison.outputs.comment }}
edit-mode: replace

- name: Write a new comment
if: github.event_name == 'pull_request' && !steps.previous-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v1.4.5
continue-on-error: true
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body: |
### Test262 coverage results

${{ steps.comparison.outputs.comment }}