Skip to content

Commit 6bfd485

Browse files
committed
Migrate CI to use swiftlang / SwiftNIO common GitHub Actions.
Motivation: * Reduce duplication * Centralise boilerplate changes when new Swift versions are picked up. * Benefit from centralised work to add new linting / test infrastructure. Modifications: Changes of note: * Use soundness checks from swiftlang/github-workflows. * Define a gRPC-specific soundness check which retains bespoke license-checking code for .swift files as the gRPC header style is very different to most templates and checks that generated code is up-to-date. Result: More test, linting, formatting coverage. More common CI with other Swift on Server projects.
1 parent 54227cb commit 6bfd485

File tree

49 files changed

+420
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+420
-287
lines changed

Diff for: .github/release.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
changelog:
2+
categories:
3+
- title: SemVer Major
4+
labels:
5+
- ⚠️ semver/major
6+
- title: SemVer Minor
7+
labels:
8+
- semver/minor
9+
- title: SemVer Patch
10+
labels:
11+
- semver/patch
12+
- title: Other Changes
13+
labels:
14+
- semver/none

Diff for: .github/workflows/ci.yaml

-82
This file was deleted.

Diff for: .github/workflows/main.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
- cron: "0 8,20 * * *"
8+
9+
jobs:
10+
unit-tests:
11+
name: Unit tests
12+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
13+
with:
14+
linux_5_9_enabled: false
15+
linux_5_10_enabled: false
16+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
17+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
18+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
19+
20+
integration-tests:
21+
name: Integration tests
22+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
23+
with:
24+
name: "Integration Tests"
25+
matrix_linux_5_9_enabled: false
26+
matrix_linux_5_10_enabled: false
27+
matrix_linux_command: "./dev/integration_tests.sh"
28+
29+
benchmarks:
30+
name: Benchmarks
31+
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
32+
with:
33+
benchmark_package_path: "IntegrationTests/Benchmarks"
34+
linux_5_9_enabled: false
35+
linux_5_10_enabled: false

Diff for: .github/workflows/pull_request.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, reopened, synchronize]
7+
8+
jobs:
9+
soundness:
10+
name: Soundness
11+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
12+
with:
13+
license_header_check_project_name: "gRPC"
14+
15+
grpc-soundness:
16+
name: Soundness
17+
uses: ./.github/workflows/soundness.yml
18+
19+
unit-tests:
20+
name: Unit tests
21+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
22+
with:
23+
linux_5_9_enabled: false
24+
linux_5_10_enabled: false
25+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
26+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
27+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
28+
29+
integration-tests:
30+
name: Integration tests
31+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
32+
with:
33+
name: "Integration Tests"
34+
matrix_linux_5_9_enabled: false
35+
matrix_linux_5_10_enabled: false
36+
matrix_linux_command: "./dev/integration_tests.sh"
37+
38+
examples:
39+
name: Examples
40+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
41+
with:
42+
name: "Examples"
43+
matrix_linux_5_9_enabled: false
44+
matrix_linux_5_10_enabled: false
45+
matrix_linux_command: "./dev/build-examples.sh"
46+
47+
benchmarks:
48+
name: Benchmarks
49+
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
50+
with:
51+
benchmark_package_path: "IntegrationTests/Benchmarks"
52+
linux_5_9_enabled: false
53+
linux_5_10_enabled: false
54+
55+
cxx-interop:
56+
name: Cxx interop
57+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
58+
with:
59+
linux_5_9_enabled: false
60+
linux_5_10_enabled: false

Diff for: .github/workflows/pull_request_label.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR
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

Diff for: .github/workflows/soundness.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Soundness
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
swift-license-check:
8+
name: Swift license headers check
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
- name: Mark the workspace as safe
16+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
17+
- name: Run license check
18+
run: |
19+
./dev/license-check.sh
20+
21+
check-generated-code:
22+
name: Check generated code
23+
runs-on: ubuntu-latest
24+
container:
25+
image: swift:latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
- name: Mark the workspace as safe
32+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
33+
- name: Install protoc
34+
run: apt update && apt install -y protobuf-compiler
35+
- name: Run soundness checks
36+
run: |
37+
./dev/check-generated-code.sh

Diff for: .license_header_template

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@@ Copyright YEARS, gRPC Authors All rights reserved.
2+
@@
3+
@@ Licensed under the Apache License, Version 2.0 (the "License");
4+
@@ you may not use this file except in compliance with the License.
5+
@@ You may obtain a copy of the License at
6+
@@
7+
@@ http://www.apache.org/licenses/LICENSE-2.0
8+
@@
9+
@@ Unless required by applicable law or agreed to in writing, software
10+
@@ distributed under the License is distributed on an "AS IS" BASIS,
11+
@@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
@@ See the License for the specific language governing permissions and
13+
@@ limitations under the License.

Diff for: .licenseignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.gitignore
2+
**/.gitignore
3+
.licenseignore
4+
.gitattributes
5+
.git-blame-ignore-revs
6+
.gitmodules
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/version-bump.commit.template
37+
.unacceptablelanguageignore
38+
LICENSE
39+
**/*.swift
40+
dev/protos/**/*.proto
41+
Examples/hello-world/Protos/HelloWorld.proto

Diff for: CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ In order to protect both you and ourselves, you will need to sign the
1717

1818
Please see the [main gRPC repository](https://github.com/grpc/grpc) for
1919
more information about gRPC.
20+
21+
### Run CI checks locally
22+
23+
You can run the GitHub Actions workflows locally using [act](https://github.com/nektos/act) or in some cases calling scripts directly. 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).

Diff for: Examples/hello-world/Protos

-37
This file was deleted.

Diff for: Examples/hello-world/Protos/HelloWorld.proto

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../..//dev/protos/upstream/grpc/examples/helloworld.proto

0 commit comments

Comments
 (0)