Skip to content

Commit

Permalink
Update from Hummingbird Project Template (#2)
Browse files Browse the repository at this point in the history
* Update from hummingbird-community-template 9afc0a3344a760a38c195679c607e2fe9a5e2c43

* added template override

* updates from template

* removed manual ci file

---------

Co-authored-by: adam-fowler <adam-fowler@users.noreply.github.com>
Co-authored-by: Simon Leeb <52261246+sliemeobn@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 24, 2024
1 parent 238ad0e commit fcaa097
Show file tree
Hide file tree
Showing 13 changed files with 268 additions and 47 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.build
.git
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
groups:
dependencies:
patterns:
- "*"
- package-ecosystem: "swift"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 5
allow:
- dependency-type: all
groups:
all-dependencies:
patterns:
- "*"
22 changes: 22 additions & 0 deletions .github/workflows/api-breakage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: API breaking changes

on:
pull_request:

jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 15
container:
image: swift:5.10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/766
- name: Mark the workspace as safe
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: API breaking changes
run: |
swift package diagnose-api-breaking-changes origin/${GITHUB_BASE_REF}
39 changes: 0 additions & 39 deletions .github/workflows/ci.yaml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches:
- main
paths:
- '**.swift'
- '**.yml'
pull_request:
workflow_dispatch:

jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
image: ["swift:5.10", "swiftlang/swift:nightly-6.0-jammy"]

container:
image: ${{ matrix.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
run: |
swift test --enable-code-coverage
- name: Convert coverage files
run: |
llvm-cov export -format="lcov" \
.build/debug/hummingbird-elementaryPackageTests.xctest \
-ignore-filename-regex="\/Tests\/" \
-ignore-filename-regex="\/Benchmarks\/" \
-instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
file: info.lcov
21 changes: 21 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Swift nightly build

on:
workflow_dispatch:

jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
image: ['nightly-focal', 'nightly-jammy', 'nightly-amazonlinux2']

container:
image: swiftlang/swift:${{ matrix.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
run: |
swift test
21 changes: 21 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validity Check

on:
pull_request:
workflow_dispatch:

jobs:
validate:
runs-on: macOS-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Dependencies
run: |
brew install mint
mint install NickLockwood/SwiftFormat@0.53.10 --no-link
- name: run script
run: ./scripts/validate.sh
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.DS_Store
/.build
.build/
.swiftpm/
.vscode/
.devcontainer/
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
Package.resolved
Package.resolved
/public
/docs
.benchmarkBaselines
9 changes: 9 additions & 0 deletions .hummingbird-community-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ci:
nightly: false
validate:
swiftformat:
version: 0.53.10
enable_tests: true
linux:
images: ["swift:5.10", "swiftlang/swift:nightly-6.0-jammy"]
mac: false
4 changes: 2 additions & 2 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Minimum swiftformat version
--minversion 0.51.0
--minversion 0.53.10

# Swift version
--swiftversion 5.9
Expand All @@ -8,7 +8,7 @@
--exclude .build

# rules
--disable redundantReturn, extensionAccessControl, typeSugar, conditionalAssignment
--disable redundantReturn, extensionAccessControl, typeSugar, conditionalAssignment, preferForLoop

# format options
--ifdef no-indent
Expand Down
54 changes: 54 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Code of Conduct

All developers should feel welcome and encouraged to contribute to Hummingbird. Because of this we have adopted the code of conduct defined by [contributor-covenant.org](https://www.contributor-covenant.org). This document is used across many open source
communities, and we think it articulates our values well. The full text is copied below:

## Contributor Code of Conduct v1.3

As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.


This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at https://www.contributor-covenant.org/version/1/3/0/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing


## Legal
By submitting a pull request, you represent that you have the right to license your contribution to the community, and agree by submitting the patch
that your contributions are licensed under the Apache 2.0 license (see [LICENSE](LICENSE)).

## Contributor Conduct
All contributors are expected to adhere to the project's [Code of Conduct](CODE_OF_CONDUCT.md).

## Submitting a bug or issue
Please ensure to include the following in your bug report
- A consise description of the issue, what happened and what you expected.
- Simple reproduction steps
- Version of the library you are using
- Contextual information (Swift version, OS etc)

## Submitting a Pull Request

Please ensure to include the following in your Pull Request
- A description of what you are trying to do. What the PR provides to the library, additional functionality, fixing a bug etc
- A description of the code changes
- Documentation on how these changes are being tested
- Additional tests to show your code working and to ensure future changes don't break your code.

Please keep your PRs to a minimal number of changes. If a PR is large try to split it up into smaller PRs. Don't move code around unnecessarily it makes comparing old with new very hard.

The main development branch of the repository is `main`.

39 changes: 39 additions & 0 deletions scripts/validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftNIO open source project
##
## Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.txt for the list of SwiftNIO project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##

SWIFT_FORMAT_VERSION=0.53.10

set -eu
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

which swiftformat > /dev/null 2>&1 || (echo "swiftformat not installed. You can install it using 'brew install swiftformat'" ; exit -1)

printf "=> Checking format... "
FIRST_OUT="$(git status --porcelain)"
if [[ -n "${CI-""}" ]]; then
printf "(using v$(mint run NickLockwood/SwiftFormat@"$SWIFT_FORMAT_VERSION" --version)) "
mint run NickLockwood/SwiftFormat@"$SWIFT_FORMAT_VERSION" . > /dev/null 2>&1
else
printf "(using v$(swiftformat --version)) "
swiftformat . > /dev/null 2>&1
fi
SECOND_OUT="$(git status --porcelain)"
if [[ "$FIRST_OUT" != "$SECOND_OUT" ]]; then
printf "\033[0;31mformatting issues!\033[0m\n"
git --no-pager diff
exit 1
else
printf "\033[0;32mokay.\033[0m\n"
fi

0 comments on commit fcaa097

Please sign in to comment.