Skip to content

Commit

Permalink
check: Change runner image to ubuntu-24.04; add step to install sys…
Browse files Browse the repository at this point in the history
…tem dependency

Change the runner image to use `ubuntu-24.04` directly, because
`ubuntu-latest` may cause CI failures when there are unexpected changes
in the future versions of the runner image.

Then also add a step to manually install the `libsqlite3-dev` package,
which we need.

The `package:sqlite3` requires the system-installed sqlite3 shared
library (`libsqlite3.so`) when running directly via Dart, on Linux.
Whereas, when running under Flutter, it uses bundled libraries provided
by `package:sqlite3_flutter_libs`.

Previously, with `ubuntu-22.04` the `libsqlite3-dev` package was
pre-installed:
  https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#installed-apt-packages
However, the `ubuntu-24.04` image no longer includes this package by
default:
  https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#installed-apt-packages

Without that package, five unit tests would fail with the following
error:
  Invalid argument(s): Failed to load dynamic library 'libsqlite3.so': libsqlite3.so: cannot open shared object file: No such file or directory
    dart:ffi                                                        new DynamicLibrary.open
    package:sqlite3/src/ffi/load_library.dart 52:27                 _defaultOpen
    package:sqlite3/src/ffi/load_library.dart 127:12                OpenDynamicLibrary.openSqlite
    package:sqlite3/src/ffi/api.dart 13:39                          sqlite3
    package:drift/native.dart 313:12                                _NativeDelegate.openDatabase
    package:drift/src/sqlite3/database.dart 79:19                   Sqlite3Delegate.open
    package:drift/src/runtime/executor/helpers/engines.dart 431:22  DelegatedDatabase.ensureOpen.<fn>
  • Loading branch information
rajveermalviya authored and gnprice committed Oct 17, 2024
1 parent f8ddff2 commit 26c2aa0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]

- name: Install system dependencies
run: TERM=dumb sudo apt install libsqlite3-dev -y

- name: Set up JDK
uses: actions/[email protected]
with:
Expand Down

0 comments on commit 26c2aa0

Please sign in to comment.