From 741a1c5e38d424c80ef4c0bdc2936c9ba54139cc Mon Sep 17 00:00:00 2001 From: Eliot Hills Date: Thu, 29 Jan 2026 12:19:06 -0400 Subject: [PATCH 1/2] WIP PR preview action (file change detection commented out to allow workflow to run) --- .github/workflows/pr.yml | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..26f44f5 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,61 @@ + +name: Build package & sample QC report on PR + +on: + pull_request: + # paths: + # - '**.js' + # - '**.ts' + # - '**.tsx' + types: + - opened + - synchronize + +concurrency: pr-${{ github.ref }} + +jobs: + build: + runs-on: ubuntu-latest + outputs: + artifact_url: ${{ steps.artifact-upload-step.outputs.artifact-url }} + steps: + - uses: actions/checkout@v5 + # Needed based on the slightly non-standard yarn version we use + # See https://github.com/actions/setup-node/issues/899 + - name: Enable Corepack before setting up Node + run: corepack enable + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Build + run: yarn build + - name: Create sample QC report + run: | + mkdir qc-report + cp -r dist/* qc-report/ + cp -r sample/default/* qc-report/ + sed -i 's%sample/default/%%g' qc-report/js/datasets.js + - name: Upload test QC report + id: artifact-upload-step + uses: actions/upload-artifact@v6 + with: + name: qc-${{ github.event.pull_request.head.sha }} + path: qc-report/**/* + comment: + runs-on: ubuntu-latest + needs: build + steps: + - name: Comment on PR with link to artifact + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Test QC report built! You can download it [here](${{ needs.build.outputs.artifact_url }}).' + }) From 02801dc60287484bdafa47ae96d17d7586b568a2 Mon Sep 17 00:00:00 2001 From: Eliot Hills Date: Thu, 29 Jan 2026 12:57:19 -0400 Subject: [PATCH 2/2] Include JS changes only in PR build --- .github/workflows/pr.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 26f44f5..bd8b565 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,12 +1,12 @@ -name: Build package & sample QC report on PR +name: Build package & sample QC report for pull request on: pull_request: - # paths: - # - '**.js' - # - '**.ts' - # - '**.tsx' + paths: + - '**.js' + - '**.ts' + - '**.tsx' types: - opened - synchronize