diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 426b541a..e33d5b58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -194,6 +194,7 @@ jobs: run: npx playwright test --retries=2 - name: Upload Playwright Test report + id: upload-galata-artifact if: always() uses: actions/upload-artifact@v3 with: @@ -202,6 +203,13 @@ jobs: ui-tests/test-results ui-tests/playwright-report + - name: Save artifact data + if: always() + uses: trungleduc/appsharingspace-pr-comment/.github/actions/save-artifact-link@v2 + with: + output_name: galata-apss + artifact_link: 'https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}/artifacts/${{ steps.upload-galata-artifact.outputs.artifact-id }}' + check_linting: name: Lint check runs-on: ubuntu-latest @@ -276,11 +284,17 @@ jobs: jupyter lite build --contents content --output-dir dist - name: Upload artifact + id: upload-jupyterlite-artifact uses: actions/upload-pages-artifact@v3 with: path: ./lite/dist retention-days: 30 + - name: Save artifact data + uses: trungleduc/appsharingspace-pr-comment/.github/actions/save-artifact-link@v2 + with: + artifact_link: 'https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}/artifacts/${{ steps.upload-jupyterlite-artifact.outputs.artifact_id }}' + deploy: needs: build-lite if: github.ref == 'refs/heads/main' diff --git a/.github/workflows/comment-on-pr.yml b/.github/workflows/comment-on-pr.yml new file mode 100644 index 00000000..3abb61b3 --- /dev/null +++ b/.github/workflows/comment-on-pr.yml @@ -0,0 +1,35 @@ +name: Add preview link to PR + +on: + workflow_run: + workflows: ['Build'] + types: + - completed + +permissions: + pull-requests: write + +jobs: + comment-preview: + runs-on: ubuntu-latest + if: > + ${{ github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' }} + steps: + - name: 'Comment APSS link on workflow' + uses: trungleduc/appsharingspace-pr-comment/.github/actions/pr-comment@v2 + with: + github_token: ${{ secrets.github_token }} + index_path: lab/index.html + comment-galata: + runs-on: ubuntu-latest + if: > + ${{ github.event.workflow_run.event == 'pull_request'}} + steps: + - name: 'Comment galata link on workflow' + uses: trungleduc/appsharingspace-pr-comment/.github/actions/pr-comment@v2 + with: + comment_prefix: '**Integration tests repot:**' + artifact_name: galata-apss + github_token: ${{ secrets.github_token }} + index_path: playwright-report/index.html