Skip to content
Merged
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
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches:
- master
- "issue*"
pull_request:
branches:
- master
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
name: Swift 5.0.1 / Ubuntu 16.04 / Kafka 5.2.2
runs-on: ubuntu-24.04

services:
zookeeper:
image: confluentinc/cp-zookeeper:5.2.2
env:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- 2181:2181

kafka:
image: confluentinc/cp-kafka:5.2.2
env:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
ports:
- 9092:9092

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Wait for Kafka
run: |
set -euo pipefail

for _ in {1..60}; do
if docker exec "${{ job.services.kafka.id }}" kafka-topics --zookeeper zookeeper:2181 --list >/dev/null 2>&1; then
exit 0
fi
sleep 2
done

docker logs "${{ job.services.zookeeper.id }}"
docker logs "${{ job.services.kafka.id }}"
exit 1

- name: Build and test
run: |
set -euo pipefail

docker run --rm --network host \
-e BROKER_ADDRESS=localhost:9092 \
-v "${PWD}:/workspace" \
-w /workspace \
swift:5.0.1-xenial \
bash -lc '
set -euo pipefail

apt-get update
apt-get install -y --no-install-recommends ca-certificates curl gnupg software-properties-common
curl -fsSL https://packages.confluent.io/deb/5.2/archive.key | apt-key add -
add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/5.2 stable main"
apt-get update
apt-get install -y --no-install-recommends librdkafka-dev

swift --version
swift build
swift test
'
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-log.git", "1.0.0"..<"1.2.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<a href="https://ibm-swift.github.io/SwiftKafka/index.html">
<img src="https://img.shields.io/badge/apidoc-SwiftKafka-1FBCE4.svg?style=flat" alt="APIDoc">
</a>
<a href="https://travis-ci.org/IBM-Swift/SwiftKafka">
<img src="https://travis-ci.org/IBM-Swift/SwiftKafka.svg?branch=master" alt="Build Status - Master">
<a href="https://github.com/Kitura/SwiftKafka/actions/workflows/ci.yml">
<img src="https://github.com/Kitura/SwiftKafka/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI">
</a>
<img src="https://img.shields.io/badge/os-macOS-green.svg?style=flat" alt="macOS">
<img src="https://img.shields.io/badge/os-linux-green.svg?style=flat" alt="Linux">
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
<a href="https://ibm-swift.github.io/SwiftKafka/index.html">
<img src="https://img.shields.io/badge/apidoc-SwiftKafka-1FBCE4.svg?style=flat" alt="APIDoc">
</a>
<a href="https://travis-ci.org/IBM-Swift/SwiftKafka">
<img src="https://travis-ci.org/IBM-Swift/SwiftKafka.svg?branch=master" alt="Build Status - Master">
<a href="https://github.com/Kitura/SwiftKafka/actions/workflows/ci.yml">
<img src="https://github.com/Kitura/SwiftKafka/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI">
</a>
<img src="https://img.shields.io/badge/os-macOS-green.svg?style=flat" alt="macOS">
<img src="https://img.shields.io/badge/os-linux-green.svg?style=flat" alt="Linux">
Expand Down
44 changes: 0 additions & 44 deletions setupKafka.sh

This file was deleted.