mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Fix Go tests execution in PR workflow
Updated the PR workflow to ensure Go tests run for pull requests and approved reviews.
This commit is contained in:
parent
70d2d52be4
commit
385f1dafb9
1 changed files with 22 additions and 7 deletions
29
.github/workflows/pr-master.yml
vendored
29
.github/workflows/pr-master.yml
vendored
|
|
@ -1,17 +1,26 @@
|
|||
name: PR Checks (master)
|
||||
|
||||
# Updated to ensure "Run Go Tests" runs for pull requests as expected.
|
||||
# Key fix: the test_go job previously required github.event.review.state == 'approved'
|
||||
# which only exists on pull_request_review events. That prevented the job from
|
||||
# running for regular pull_request events (opened / synchronize / reopened).
|
||||
# New logic: run tests for pull_request events, and also allow running when a
|
||||
# pull_request_review is submitted with state == 'approved'.
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- master
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch: {}
|
||||
|
||||
name: PR Checks (master)
|
||||
|
||||
jobs:
|
||||
check_docs:
|
||||
name: Check Docs
|
||||
if: ${{github.repository == 'wailsapp/wails' && github.base_ref == 'master'}}
|
||||
if: ${{ github.repository == 'wailsapp/wails' && github.base_ref == 'master' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
@ -23,7 +32,6 @@ jobs:
|
|||
files: |
|
||||
website/**/*.mdx
|
||||
website/**/*.md
|
||||
|
||||
- name: Run step only when files change.
|
||||
if: steps.verify-changed-files.outputs.files_changed != 'true'
|
||||
run: |
|
||||
|
|
@ -32,11 +40,18 @@ jobs:
|
|||
test_go:
|
||||
name: Run Go Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
# Run when:
|
||||
# - the event is a pull_request (opened/synchronize/reopened) OR
|
||||
# - the event is a pull_request_review AND the review state is 'approved'
|
||||
# plus other existing filters (not the update-sponsors branch, repo and base_ref)
|
||||
if: >
|
||||
github.repository == 'wailsapp/wails' &&
|
||||
github.base_ref == 'master' &&
|
||||
github.event.pull_request.head.ref != 'update-sponsors' &&
|
||||
github.event.review.state == 'approved' &&
|
||||
github.repository == 'wailsapp/wails' &&
|
||||
github.base_ref == 'master'
|
||||
(
|
||||
github.event_name == 'pull_request' ||
|
||||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
|
||||
)
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue