mirror of
https://github.com/immich-app/devtools.git
synced 2026-09-30 13:23:00 +08:00
96 lines
2.9 KiB
YAML
96 lines
2.9 KiB
YAML
name: Test sticky-comment
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
pre-job:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
should_run: ${{ steps.check.outputs.should_run }}
|
|
steps:
|
|
- name: Check what should run
|
|
id: check
|
|
uses: immich-app/devtools/actions/pre-job@75493d49052d536863fc96100086782c5279b145 # pre-job-action-v2.1.1
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
filters: |
|
|
sticky_comment:
|
|
- 'actions/sticky-comment/**'
|
|
force-filters: |
|
|
- '.github/workflows/test-sticky-comment.yml'
|
|
- 'package.json'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'pnpm-lock.yaml'
|
|
|
|
build-check:
|
|
name: Verify dist is up to date
|
|
needs: pre-job
|
|
if: ${{ fromJSON(needs.pre-job.outputs.should_run).sticky_comment == true }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Mise
|
|
uses: immich-app/devtools/actions/use-mise@06a9ef925332c91be647d6256642b86b398592c8 # use-mise-action-v3.2.1
|
|
with:
|
|
github_token: ${{ github.token }}
|
|
|
|
- run: pnpm --filter @immich/sticky-comment-action install --frozen-lockfile
|
|
- run: pnpm --filter @immich/sticky-comment-action check
|
|
- run: pnpm --filter @immich/sticky-comment-action build
|
|
|
|
- name: Verify dist/ matches source
|
|
run: |
|
|
if ! git diff --exit-code actions/sticky-comment/dist; then
|
|
echo "::error::dist/ is out of date. Run 'pnpm --filter @immich/sticky-comment-action build' and commit the result."
|
|
exit 1
|
|
fi
|
|
|
|
smoke:
|
|
name: Smoke test
|
|
needs: pre-job
|
|
if: ${{ fromJSON(needs.pre-job.outputs.should_run).sticky_comment == true && !github.event.pull_request.head.repo.fork }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Pre-clean (exercise delete path)
|
|
uses: ./actions/sticky-comment
|
|
with:
|
|
id: smoke-test
|
|
delete: true
|
|
|
|
- name: Create comment (exercise create path)
|
|
uses: ./actions/sticky-comment
|
|
with:
|
|
id: smoke-test
|
|
body: |
|
|
Smoke test for sticky-comment action — created by run ${{ github.run_id }}.
|
|
|
|
- name: Update comment (exercise update path)
|
|
uses: ./actions/sticky-comment
|
|
with:
|
|
id: smoke-test
|
|
body: |
|
|
✅ Smoke test for sticky-comment action passed — run ${{ github.run_id }}.
|