Skip to content

Commit 27a5a3c

Browse files
adam-fowlerthoven87
andcommitted
Initial commit
Co-authored-by: Stevenson Michel <130018170+thoven87@users.noreply.github.com>
0 parents  commit 27a5a3c

18 files changed

+1324
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @adam-fowler @Joannis @thoven87

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: adam-fowler

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
groups:
8+
dependencies:
9+
patterns:
10+
- "*"
11+
- package-ecosystem: "swift"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"
15+
open-pull-requests-limit: 5
16+
allow:
17+
- dependency-type: all
18+
groups:
19+
all-dependencies:
20+
patterns:
21+
- "*"

.github/workflows/api-breakage.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: API breaking changes
2+
3+
on:
4+
pull_request:
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}-apibreakage
7+
cancel-in-progress: true
8+
9+
jobs:
10+
linux:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
container:
14+
image: swift:latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
# https://github.com/actions/checkout/issues/766
21+
- name: Mark the workspace as safe
22+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
23+
- name: API breaking changes
24+
run: |
25+
swift package diagnose-api-breaking-changes origin/${GITHUB_BASE_REF}

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 2.x.x
8+
paths:
9+
- '**.swift'
10+
- '**.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- 2.x.x
15+
workflow_dispatch:
16+
17+
jobs:
18+
# macOS:
19+
# runs-on: macOS-13
20+
# steps:
21+
# - name: Checkout
22+
# uses: actions/checkout@v4
23+
# - name: SPM tests
24+
# run: swift test --enable-code-coverage
25+
# - name: Convert coverage files
26+
# run: |
27+
# xcrun llvm-cov export -format "lcov" \
28+
# .build/debug/hummingbirdPackageTests.xctest/Contents/MacOs/hummingbirdPackageTests \
29+
# -ignore-filename-regex="\/Tests\/" \
30+
# -ignore-filename-regex="\/Benchmarks\/" \
31+
# -instr-profile=.build/debug/codecov/default.profdata > info.lcov
32+
# - name: Upload to codecov.io
33+
# uses: codecov/codecov-action@v4
34+
# with:
35+
# file: info.lcov
36+
linux:
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 15
39+
strategy:
40+
matrix:
41+
image:
42+
- 'swift:5.9'
43+
- 'swift:5.10'
44+
postgres-image:
45+
- 'postgres:16'
46+
- 'postgres:14'
47+
- 'postgres:12'
48+
include:
49+
- postgres-image: postgres:16
50+
postgres-auth: scram-sha-256
51+
- postgres-image: postgres:14
52+
postgres-auth: md5
53+
- postgres-image: postgres:12
54+
postgres-auth: trust
55+
container:
56+
image: ${{ matrix.image }}
57+
volumes: [ 'pgrunshare:/var/run/postgresql' ]
58+
env:
59+
POSTGRES_DB: 'test_database'
60+
POSTGRES_USER: 'test_user'
61+
POSTGRES_PASSWORD: 'test_password'
62+
POSTGRES_HOSTNAME: 'psql'
63+
POSTGRES_SOCKET: '/var/run/postgresql/.s.PGSQL.5432'
64+
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }}
65+
services:
66+
psql:
67+
image: ${{ matrix.postgres-image }}
68+
volumes: [ 'pgrunshare:/var/run/postgresql' ]
69+
env:
70+
POSTGRES_DB: 'test_database'
71+
POSTGRES_USER: 'test_user'
72+
POSTGRES_PASSWORD: 'test_password'
73+
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }}
74+
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }}
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
- name: Test
79+
run: |
80+
swift test --enable-code-coverage
81+
- name: Convert coverage files
82+
run: |
83+
llvm-cov export -format="lcov" \
84+
.build/debug/hummingbird-postgresPackageTests.xctest \
85+
-ignore-filename-regex="\/Tests\/" \
86+
-ignore-filename-regex="\/Benchmarks\/" \
87+
-instr-profile .build/debug/codecov/default.profdata > info.lcov
88+
- name: Upload to codecov.io
89+
uses: codecov/codecov-action@v4
90+
with:
91+
file: info.lcov

.github/workflows/nightly.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Swift nightly build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
linux:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 15
10+
strategy:
11+
matrix:
12+
image: ['nightly-focal', 'nightly-jammy', 'nightly-amazonlinux2']
13+
services:
14+
redis:
15+
image: redis
16+
ports:
17+
- 6379:6379
18+
options: --entrypoint redis-server
19+
20+
container:
21+
image: swiftlang/swift:${{ matrix.image }}
22+
env:
23+
REDIS_HOSTNAME: "redis"
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Test
29+
run: |
30+
swift test

.github/workflows/validate.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Validity Check
2+
3+
on:
4+
pull_request:
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}-validate
7+
cancel-in-progress: true
8+
9+
jobs:
10+
validate:
11+
runs-on: macOS-latest
12+
timeout-minutes: 15
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
- name: Install Dependencies
19+
run: |
20+
brew install mint
21+
mint install NickLockwood/SwiftFormat@0.53.10 --no-link
22+
- name: run script
23+
run: ./scripts/validate.sh

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
.build/
3+
.swiftpm/
4+
.vscode/
5+
.devcontainer/
6+
/Packages
7+
/*.xcodeproj
8+
xcuserdata/
9+
Package.resolved
10+
/public
11+
/docs
12+
.benchmarkBaselines

.spi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: 1
2+
external_links:
3+
documentation: "https://docs.hummingbird.codes/2.0/documentation/swiftjobspostgres"

.swiftformat

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Minimum swiftformat version
2+
--minversion 0.51.0
3+
4+
# Swift version
5+
--swiftversion 5.9
6+
7+
# file options
8+
--exclude .build
9+
10+
# rules
11+
--disable redundantReturn, extensionAccessControl, typeSugar, conditionalAssignment
12+
13+
# format options
14+
--ifdef no-indent
15+
--nospaceoperators ...,..<
16+
--patternlet inline
17+
--self insert
18+
--stripunusedargs unnamed-only
19+
20+
#--maxwidth 150
21+
--wraparguments before-first
22+
--wrapparameters before-first
23+
--wrapcollections before-first
24+
25+
#file header
26+
# --header "//===----------------------------------------------------------------------===//\n//\n// This source file is part of the Hummingbird server framework project\n//\n// Copyright (c) {created.year}-{year} the Hummingbird authors\n// Licensed under Apache License v2.0\n//\n// See LICENSE.txt for license information\n// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors\n//\n// SPDX-License-Identifier: Apache-2.0\n//\n//===----------------------------------------------------------------------===//"

0 commit comments

Comments
 (0)