Skip to content

Commit

Permalink
chore(workflow): add ability to trigger tests on PR with specific com…
Browse files Browse the repository at this point in the history
…ment (#31)
  • Loading branch information
mslxl committed Mar 19, 2024
1 parent 4032a63 commit 42cfaa0
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/test-on-pr.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: "test-on-pr"
on: [pull_request]
name: "test-on-pr-issue"
on:
issue_comment:
types: [created]

jobs:
test-tauri:
if: github.event.issue.pull_request && (contains(github.event.comment.body, '/test') || contains(github.event.comment.body, '/build'))
strategy:
fail-fast: false
fail-fast: true
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- uses: actions/checkout@v3
if: success()
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: setup node
uses: actions/setup-node@v3
with:
Expand All @@ -34,3 +42,17 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: bundle
path: src-tauri/target/release/bundle/**/*
if-no-files-found: error
retention-days: 7
compression-level: 9
- name: Set latest commit status as ${{ job.status }}
uses: myrotvorets/set-commit-status-action@master
if: always()
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}

0 comments on commit 42cfaa0

Please sign in to comment.