Skip to content

Commit f56093a

Browse files
committed
[ci] update PR Checks conditions
1 parent 8519d8f commit f56093a

File tree

1 file changed

+174
-0
lines changed

1 file changed

+174
-0
lines changed
+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: Build + Test v3
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- v3-alpha
8+
pull_request_review:
9+
types: [submitted]
10+
branches:
11+
- v3-alpha
12+
-
13+
jobs:
14+
check_approval:
15+
name: Check PR Approval
16+
runs-on: ubuntu-latest
17+
outputs:
18+
approved: ${{ steps.check.outputs.approved }}
19+
steps:
20+
- name: Check if PR is approved
21+
id: check
22+
run: |
23+
if [[ "${{ github.event.review.state }}" == "approved" || "${{ github.event.pull_request.approved }}" == "true" ]]; then
24+
echo "approved=true" >> $GITHUB_OUTPUT
25+
else
26+
echo "approved=false" >> $GITHUB_OUTPUT
27+
fi
28+
29+
test_go:
30+
name: Run Go Tests v3
31+
needs: check_approval
32+
runs-on: ${{ matrix.os }}
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [windows-latest, macos-latest, ubuntu-latest]
37+
go-version: [1.24]
38+
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
43+
- name: Install linux dependencies
44+
uses: awalsh128/cache-apt-pkgs-action@latest
45+
if: matrix.os == 'ubuntu-latest'
46+
with:
47+
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config xvfb x11-xserver-utils at-spi2-core xdg-desktop-portal-gtk
48+
version: 1.0
49+
50+
- name: Setup Go
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: ${{ matrix.go-version }}
54+
cache-dependency-path: "v3/go.sum"
55+
56+
- name: Install Task
57+
uses: arduino/setup-task@v2
58+
with:
59+
version: 3.x
60+
repo-token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Build Examples
63+
working-directory: ./v3
64+
run: task test:examples
65+
66+
- name: Run tests (mac)
67+
if: matrix.os == 'macos-latest'
68+
env:
69+
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
70+
working-directory: ./v3
71+
run: go test -v ./...
72+
73+
- name: Run tests (windows)
74+
if: matrix.os == 'windows-latest'
75+
working-directory: ./v3
76+
run: go test -v ./...
77+
78+
- name: Run tests (ubuntu)
79+
if: matrix.os == 'ubuntu-latest'
80+
working-directory: ./v3
81+
run: >
82+
xvfb-run --auto-servernum
83+
sh -c '
84+
dbus-update-activation-environment --systemd --all &&
85+
go test -v ./...
86+
'
87+
88+
- name: Typecheck binding generator output
89+
working-directory: ./v3
90+
run: task generator:test:check
91+
92+
test_js:
93+
name: Run JS Tests
94+
needs: check_approval
95+
runs-on: ubuntu-latest
96+
strategy:
97+
matrix:
98+
node-version: [20.x]
99+
100+
steps:
101+
- name: Checkout code
102+
uses: actions/checkout@v4
103+
104+
- name: Use Node.js ${{ matrix.node-version }}
105+
uses: actions/setup-node@v4
106+
with:
107+
node-version: ${{ matrix.node-version }}
108+
109+
- name: Install dependencies
110+
run: npm install
111+
working-directory: v2/internal/frontend/runtime
112+
113+
- name: Run tests
114+
run: npm test
115+
working-directory: v2/internal/frontend/runtime
116+
117+
test_templates:
118+
name: Test Templates
119+
needs: test_go
120+
runs-on: ${{ matrix.os }}
121+
strategy:
122+
fail-fast: false
123+
matrix:
124+
os: [ubuntu-latest, windows-latest, macos-latest]
125+
template:
126+
- svelte
127+
- svelte-ts
128+
- vue
129+
- vue-ts
130+
- react
131+
- react-ts
132+
- preact
133+
- preact-ts
134+
- lit
135+
- lit-ts
136+
- vanilla
137+
- vanilla-ts
138+
go-version: [1.24]
139+
steps:
140+
- name: Checkout
141+
uses: actions/checkout@v4
142+
143+
- name: Install linux dependencies
144+
uses: awalsh128/cache-apt-pkgs-action@latest
145+
if: matrix.os == 'ubuntu-latest'
146+
with:
147+
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
148+
version: 1.0
149+
150+
- name: Setup Go
151+
uses: actions/setup-go@v5
152+
with:
153+
go-version: ${{ matrix.go-version }}
154+
cache-dependency-path: "v3/go.sum"
155+
156+
- name: Install Task
157+
uses: arduino/setup-task@v2
158+
with:
159+
version: 3.x
160+
repo-token: ${{ secrets.GITHUB_TOKEN }}
161+
162+
- name: Build Wails3 CLI
163+
working-directory: ./v3
164+
run: |
165+
task install
166+
wails3 doctor
167+
168+
- name: Generate template '${{ matrix.template }}'
169+
run: |
170+
mkdir -p ./test-${{ matrix.template }}
171+
cd ./test-${{ matrix.template }}
172+
wails3 init -n ${{ matrix.template }} -t ${{ matrix.template }}
173+
cd ${{ matrix.template }}
174+
wails3 build

0 commit comments

Comments
 (0)