Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/ubuntu-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md

name: "Linux CI"

on:
push:
branches:
- master
- development
paths:
- 'GRDB/**'
- 'Tests/**'
- '.github/workflows/**'
- 'Makefile'
- 'Package.swift'
- 'SQLiteCustom/src'
pull_request:
paths:
- 'GRDB/**'
- 'Tests/**'
- '.github/workflows/**'
- 'Makefile'
- 'Package.swift'
- 'SQLiteCustom/src'

concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: read

jobs:
build-and-test-on-linux:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
swift: ["6.2", "6.1"]
steps:
- name: Checkout Repository
uses: actions/checkout@v5

- name: Install Swift Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
binutils \
git \
gnupg2 \
libc6-dev \
libcurl4-openssl-dev \
libedit2 \
libgcc-13-dev \
libpython3-dev \
libsqlite3-0 \
libstdc++-13-dev \
libxml2-dev \
libz3-dev \
pkg-config \
python3-lldb \
tzdata \
unzip \
zip \
zlib1g-dev \
wget \
curl \
ca-certificates \
util-linux

- name: Cache Swiftly toolchains
id: cache-swiftly
uses: actions/cache@v4
with:
path: ${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}
key: swiftly-${{ matrix.os }}-${{ matrix.swift }}

- name: Install Swift Using Swiftly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could alternatively just use uses: swift-actions/setup-swift@next as per swift-actions/setup-swift#710. I've been using it in other actions, and it seems quite stable.

Copy link
Author

@thinkpractice thinkpractice Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did use setup-swift@v2 before but that didn't support swift 6.2. Also, it threw some random errors with the gpg verification (?) of swift, which made the pipeline fail. UPDATE apparently this gpg issue is also mentioned here, i.e. "Investigate GPG issues on linux". That's why I decided to add the swiftly code myself. I agree it would be better to use the setup-swift action in the future. I guess then @next selects the latest v3 version that uses swiftly as well? I saw on its PR that it's not yet merged into main right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and I saw there's a possibility to cache the swiftly install but it seems with the current code it doesn't do anything. Not sure whether the path I added (${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}) is evaluated correctly or whether it's an issue with the cache action itself. @marcprux, @groue does any of you have some experience with this?

if: steps.cache-swiftly.outputs.cache-hit != 'true'
run: |
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz
tar zxf swiftly-$(uname -m).tar.gz
./swiftly init --quiet-shell-followup -y --skip-install
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"
hash -r
swiftly install ${{ matrix.swift }} --assume-yes --use
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"

- name: Build SPM Package
run: |
swift build -c release

- name: Run tests
run: |
swift test -c release
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<a href="https://developer.apple.com/swift/"><img alt="Swift 6.1" src="https://img.shields.io/badge/swift-6.1-orange.svg?style=flat"></a>
<a href="https://github.com/groue/GRDB.swift/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/groue/GRDB.swift.svg?maxAge=2592000"></a>
<a href="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml"><img alt="CI Status" src="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml/badge.svg?branch=master"></a>
<a href="https://github.com/groue/GRDB.swift/actions/workflows/ubuntu-ci.yml"><img alt="Linux Status" src="https://github.com/groue/GRDB.swift/actions/workflows/ubuntu-ci.yml/badge.svg?branch=master"></a>
</p>

**Latest release**: December 13, 2025 • [version 7.9.0](https://github.com/groue/GRDB.swift/tree/v7.9.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 6 to GRDB 7](Documentation/GRDB7MigrationGuide.md)
Expand Down
Loading