Skip to content

ci: fix runtime publish (tag/Node), commit regenerated runtime back, auto-commit sponsor image #3413

ci: fix runtime publish (tag/Node), commit regenerated runtime back, auto-commit sponsor image

ci: fix runtime publish (tag/Node), commit regenerated runtime back, auto-commit sponsor image #3413

Workflow file for this run

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
pull_request_review:
types: [submitted]
branches:
- master
workflow_dispatch: {}
name: PR Checks (master)
permissions:
contents: read
jobs:
check_docs:
name: Check Docs
if: >
github.repository == 'wailsapp/wails' &&
(
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.base.ref == 'master'
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify Changed files
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
id: verify-changed-files
with:
files: |
website/**/*.mdx
website/**/*.md
- name: Run step only when files change.
if: steps.verify-changed-files.outputs.files_changed != 'true'
run: |
echo "::warning::Feature branch does not contain any changes to the website."
test_go:
name: Run Go Tests
runs-on: ${{ matrix.os }}
if: >
github.repository == 'wailsapp/wails' &&
github.event.pull_request.head.ref != 'update-sponsors' &&
(
github.event_name == 'workflow_dispatch' ||
(
github.event.pull_request.base.ref == 'master' &&
(
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
)
)
)
env:
GOWORK: "off"
strategy:
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
go-version: ['1.25']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install linux dependencies (22.04)
uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-22.04'
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
version: 1.0
- name: Install linux dependencies (24.04)
uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-24.04'
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
version: 1.0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: v2/go.sum
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: ./v2
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest' && matrix.os != 'ubuntu-24.04'
working-directory: ./v2
run: go test -v ./...
- name: Run tests (Ubuntu 24.04)
if: matrix.os == 'ubuntu-24.04'
working-directory: ./v2
run: go test -v -tags webkit2_41 ./...
# Gate job: provides the bare "Run Go Tests" check name that branch protection requires.
# The matrix job above posts "Run Go Tests (os, version)" per platform; this job
# aggregates those results under the exact name the rule expects.
test_go_gate:
name: Run Go Tests
runs-on: ubuntu-latest
needs: [test_go]
if: always()
steps:
- name: Check matrix result
run: |
result="${{ needs.test_go.result }}"
if [[ "$result" == "success" || "$result" == "skipped" ]]; then
echo "Go tests result: $result — gate passed"
else
echo "Go tests result: $result — gate failed"
exit 1
fi
# This job will run instead of test_go for the update-sponsors branch
skip_tests:
name: Skip Tests (Sponsor Update)
if: github.event.pull_request.head.ref == 'update-sponsors'
runs-on: ubuntu-latest
steps:
- name: Skip tests for sponsor updates
run: |
echo "Skipping tests for sponsor update branch"
echo "This is an automated update of the sponsors image."
continue-on-error: true
# Aggregate job that satisfies the "Run Go Tests" branch protection required check.
# Matrix jobs report as "Run Go Tests (os, version)" — no single check with the bare
# name is ever posted, so the requirement is never fulfilled without this fan-in job.
go_test_results:
name: Run Go Tests
if: >
always() &&
github.repository == 'wailsapp/wails' &&
(
github.event.pull_request.head.ref == 'update-sponsors' ||
(
github.event.pull_request.head.ref != 'update-sponsors' &&
(
github.event_name == 'workflow_dispatch' ||
(
github.event.pull_request.base.ref == 'master' &&
(
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
)
)
)
)
)
needs: [test_go, skip_tests]
runs-on: ubuntu-latest
steps:
- run: |
test_result="${{ needs.test_go.result }}"
skip_result="${{ needs.skip_tests.result }}"
branch="${{ github.event.pull_request.head.ref }}"
if [[ "$test_result" == "success" ]]; then
exit 0
fi
if [[ "$branch" == "update-sponsors" && "$skip_result" == "success" ]]; then
exit 0
fi
echo "Go tests result: $test_result"
echo "Skip tests result: $skip_result"
exit 1