chore: enable snapshot integration test #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
- name: Update snapshot | |
run: npm run update-snapshot | |
- name: Prepare diff for comment | |
id: diff | |
continue-on-error: true | |
run: | | |
set +e | |
body=$(git diff --exit-code --diff-filter=AM $GITHUB_SHA -- ':tests/grammar/integration/' 2>&1) | |
echo "exitcode=$?" >> $GITHUB_OUTPUT | |
body="${body//'<'/'<'}" | |
body="${body//'>'/'>'}" | |
delimiter="$(openssl rand -hex 8)" | |
echo "body<<${delimiter}" >> $GITHUB_OUTPUT | |
echo "${body:0:64000}" >> $GITHUB_OUTPUT | |
echo "${delimiter}" >> $GITHUB_OUTPUT | |
- uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' && steps.diff.outputs.exitcode == '1' | |
with: | |
header: sticky-comment-for-git-diff | |
hide_and_recreate: true | |
hide_classify: "OUTDATED" | |
message: | | |
**Found changes in the generated clients. Please review.** | |
<details> | |
<summary>Diff 📖</summary> | |
<pre lang="diff"><code> | |
${{ steps.diff.outputs.body }} | |
</code></pre> | |
</details> | |
- uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' && steps.diff.outputs.exitcode == '0' | |
with: | |
header: sticky-comment-for-git-diff | |
hide: true | |
hide_classify: "OUTDATED" |