blob: 6d24e13fccd69b73a07cbab2884e351be61b7c12 [file] [log] [blame]
name: Snapshot tests
on:
workflow_run:
workflows: [Validate]
types:
- completed
jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-workflow_run-status@v1
if: github.event.workflow_run.event == 'pull_request'
- name: 'Download artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "env"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/env.zip`, Buffer.from(download.data));
- name: 'Unzip artifact'
run: |
unzip env.zip
ls -ltR
while read line; do
echo "$line" >> $GITHUB_ENV
done < env
- name: 'Post PR comment'
issue: mshick/add-pr-comment@v2
if: github.event.workflow_run.event == 'pull_request'
with:
number: ${{ env.PR_NUMBER }}
message-id: ${{ env.GITHUB_SHA }}
message: |
**Snapshot Tests**
**API 23**: [Report](https://happo.io/a/27/report/${{ github.sha }}-android23) [Diff](https://happo.io/a/27/p/27/compare/master-android23/${{ github.sha }}-android23)
**API 31**: [Report](https://happo.io/a/27/report/${{ github.sha }}-android31) [Diff](https://happo.io/a/27/p/27/compare/master-android31/${{ github.sha }}-android31)