Skip to content

Commit

Permalink
Fix build for Linux/v2.9.0 (#3545)
Browse files Browse the repository at this point in the history
* Fix #3542

* Pipeline updates

* More Pipeline updates

* Test against 1.21

* Add build tag for 24.04

* Update test for 24.04

* Update test for 24.04

* Update test for 24.04

* Update build for 24.04

* Cache apt packages

* Fix test in PR pipeline
  • Loading branch information
leaanthony authored Jun 17, 2024
1 parent fdbfdef commit b40fd93
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-11]
os: [ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest, macos-11]
go-version: ['1.21']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
- 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

- 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@v4
Expand All @@ -37,10 +45,15 @@ jobs:
run: go test -v ./...

- name: Run tests (!mac)
if: matrix.os != 'macos-latest' && matrix.os != 'macos-11'
if: matrix.os != 'macos-latest' && matrix.os != 'macos-11' && 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 ./...

test_js:
name: Run JS Tests
if: github.repository == 'wailsapp/wails'
Expand Down Expand Up @@ -73,7 +86,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04, macos-11]
template:
[
svelte,
Expand Down Expand Up @@ -107,14 +120,29 @@ jobs:
go install
wails -help
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
- name: Install linux dependencies ( 22.04 )
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config

- name: Generate template '${{ matrix.template }}'
- name: Install linux dependencies ( 24.04 )
if: matrix.os == 'ubuntu-24.04'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config

- name: Generate & Build template '${{ matrix.template }}'
if: matrix.os != 'ubuntu-24.04'
run: |
mkdir -p ./test-${{ matrix.template }}
cd ./test-${{ matrix.template }}
wails init -n ${{ matrix.template }} -t ${{ matrix.template }} -ci
cd ${{ matrix.template }}
wails build -v 2
- name: Generate & Build template '${{ matrix.template }}' (ubuntu-24.04)
if: matrix.os == 'ubuntu-24.04'
run: |
mkdir -p ./test-${{ matrix.template }}
cd ./test-${{ matrix.template }}
wails init -n ${{ matrix.template }} -t ${{ matrix.template }} -ci
cd ${{ matrix.template }}
wails build -v 2 -tags webkit2_41
19 changes: 14 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,21 @@ jobs:
if: github.event.review.state == 'approved'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: ['1.22']
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
go-version: ['1.21']

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
- name: Install linux dependencies ( 22.04 )
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config

- name: Install linux dependencies ( 24.04 )
if: matrix.os == 'ubuntu-24.04'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config

- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -79,6 +83,11 @@ jobs:
run: go test -v ./...

- name: Run tests (!mac)
if: matrix.os != 'macos-latest'
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 ./...
2 changes: 1 addition & 1 deletion v2/internal/frontend/desktop/linux/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ GtkWidget *SetupWebview(void *contentManager, GtkWindow *window, int hideWindowO

if(disableWebViewDragAndDrop)
{
gtk_drag_dest_unset(G_OBJECT(webview));
gtk_drag_dest_unset(webview);
}

if(enableDragAndDrop)
Expand Down

0 comments on commit b40fd93

Please sign in to comment.