Skip to content

Commit bc93cfe

Browse files
authored
Configuration for GitHub actions (#18)
### Motivation: Moving CI to github actions as old CI is end of life. ### Modifications: Add GitHub actions configuration. Remove docker config used by old CI. ### Result: Modern CI used.
1 parent 383f36e commit bc93cfe

15 files changed

+141
-414
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
unit-tests:
9+
name: Unit tests
10+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
11+
with:
12+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
13+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
14+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
15+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
16+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
17+
18+
cxx-interop:
19+
name: Cxx interop
20+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main

.github/workflows/pull_request.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
soundness:
9+
name: Soundness
10+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
11+
with:
12+
license_header_check_project_name: "SwiftNIO"
13+
14+
unit-tests:
15+
name: Unit tests
16+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
17+
with:
18+
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
19+
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
20+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
21+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
22+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
23+
24+
cxx-interop:
25+
name: Cxx interop
26+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, reopened, synchronize]
6+
7+
jobs:
8+
semver-label-check:
9+
name: Semantic Version label check
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 1
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Check for Semantic Version label
18+
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

.github/workflows/scheduled.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Scheduled
2+
3+
on:
4+
schedule:
5+
- cron: "0 8,20 * * *"
6+
7+
jobs:
8+
unit-tests:
9+
name: Unit tests
10+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
11+
with:
12+
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
13+
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
14+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
15+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
16+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
17+
18+
cxx-interop:
19+
name: Cxx interop
20+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main

.licenseignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.gitignore
2+
**/.gitignore
3+
.licenseignore
4+
.unacceptablelanguageignore
5+
.gitattributes
6+
.git-blame-ignore-revs
7+
.mailfilter
8+
.mailmap
9+
.spi.yml
10+
.swift-format
11+
.editorconfig
12+
.github/*
13+
*.md
14+
*.txt
15+
*.yml
16+
*.yaml
17+
*.json
18+
Package.swift
19+
**/Package.swift
20+
Package@-*.swift
21+
**/Package@-*.swift
22+
Package.resolved
23+
**/Package.resolved
24+
Makefile
25+
*.modulemap
26+
**/*.modulemap
27+
**/*.docc/*
28+
*.xcprivacy
29+
**/*.xcprivacy
30+
*.symlink
31+
**/*.symlink
32+
Dockerfile
33+
**/Dockerfile
34+
Snippets/*
35+
dev/git.commit.template
36+
dev/update-benchmark-thresholds
37+
*.crt
38+
**/*.crt
39+
*.pem
40+
**/*.pem
41+
*.der
42+
**/*.der
43+
.swiftformat

CONTRIBUTING.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,10 @@ We require that your commit messages match our template. The easiest way to do t
6060

6161
git config commit.template dev/git.commit.template
6262

63-
### Run `./scripts/soundness.sh`
63+
### Run CI checks locally
6464

65-
The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-nio-oblivious-http/blob/main/scripts/soundness.sh)
66-
that enforces additional checks, like license headers and formatting style.
67-
68-
Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
69-
on minor changes such as a missing `self.` or similar formatting issues.
70-
71-
For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory:
72-
73-
```bash
74-
cat << EOF > .git/hooks/pre-push
75-
76-
if [[ -f "scripts/soundness.sh" ]]; then
77-
scripts/soundness.sh
78-
fi
79-
EOF
80-
```
81-
82-
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
83-
84-
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
65+
You can run the Github Actions workflows locally using
66+
[act](https://github.com/nektos/act). For detailed steps on how to do this please see [https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally](https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally).
8567

8668
## How to contribute your work
8769

Package.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ let package = Package(
2121
.macOS("14"),
2222
.iOS("17"),
2323
.tvOS("17"),
24-
.watchOS("10")
24+
.watchOS("10"),
2525
],
2626
products: [
2727
.library(
2828
name: "ObliviousHTTP",
29-
targets: ["ObliviousHTTP"]),
29+
targets: ["ObliviousHTTP"]
30+
),
3031
.library(
3132
name: "ObliviousX",
32-
targets: ["ObliviousX"]),
33+
targets: ["ObliviousX"]
34+
),
3335
],
3436
dependencies: [
3537
.package(url: "https://github.com/apple/swift-nio.git", from: "2.54.0"),
@@ -41,12 +43,14 @@ let package = Package(
4143
dependencies: [
4244
.product(name: "NIOCore", package: "swift-nio"),
4345
.product(name: "NIOHTTP1", package: "swift-nio"),
44-
]),
46+
]
47+
),
4548
.target(
4649
name: "ObliviousX",
4750
dependencies: [
48-
.product(name: "Crypto", package: "swift-crypto"),
49-
]),
51+
.product(name: "Crypto", package: "swift-crypto")
52+
]
53+
),
5054
.testTarget(
5155
name: "ObliviousHTTPTests",
5256
dependencies: [
@@ -62,6 +66,6 @@ let package = Package(
6266
"ObliviousX",
6367
.product(name: "Crypto", package: "swift-crypto"),
6468
]
65-
)
69+
),
6670
]
6771
)

docker/Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

docker/docker-compose.2204.510.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

docker/docker-compose.2204.58.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)