Skip to content

Commit aa37de7

Browse files
authored
Enable macOS CI on pull requests (#754)
Motivation: * Improve test coverage Modifications: Enable macOS CI to be run on pull request commits and make the use of the nightly runner pool for main.yml jobs explicit. Result: Improved test coverage.
1 parent 1e668a8 commit aa37de7

File tree

2 files changed

+61
-49
lines changed

2 files changed

+61
-49
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
name: macOS tests
3636
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
3737
with:
38+
runner_pool: nightly
3839
build_scheme: swift-openapi-generator-Package
3940
ios_xcode_build_enabled: false
4041
watchos_xcode_build_enabled: false

.github/workflows/pull_request.yml

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,70 @@
11
name: PR
22

33
on:
4-
pull_request:
5-
types: [opened, reopened, synchronize]
4+
pull_request:
5+
types: [opened, reopened, synchronize]
66

77
jobs:
8-
soundness:
9-
name: Soundness
10-
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
11-
with:
12-
api_breakage_check_enabled: false
13-
license_header_check_project_name: "SwiftOpenAPIGenerator"
14-
yamllint_check_enabled: false
8+
soundness:
9+
name: Soundness
10+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
11+
with:
12+
api_breakage_check_enabled: false
13+
license_header_check_project_name: "SwiftOpenAPIGenerator"
14+
yamllint_check_enabled: false
1515

16-
unit-tests:
17-
name: Unit tests
18-
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
19-
with:
20-
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
21-
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
22-
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
23-
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
24-
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
16+
unit-tests:
17+
name: Unit tests
18+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
19+
with:
20+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
21+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
22+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
23+
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
24+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2525

26-
integration-test:
27-
name: Integration test
28-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
26+
integration-test:
27+
name: Integration test
28+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
29+
with:
30+
name: "Integration test"
31+
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
32+
matrix_linux_nightly_main_enabled: false
33+
34+
compatibility-test:
35+
name: Compatibility test
36+
runs-on: ubuntu-latest
37+
container:
38+
image: swift:latest
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
2942
with:
30-
name: "Integration test"
31-
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
32-
matrix_linux_nightly_main_enabled: false
43+
persist-credentials: false
44+
- name: Run OpenAPI document compatibilty test
45+
env:
46+
SWIFT_OPENAPI_COMPATIBILITY_TEST_ENABLE: "true"
47+
SWIFT_OPENAPI_COMPATIBILITY_TEST_SKIP_BUILD: "true"
48+
SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER: OpenAPIGeneratorReferenceTests.CompatibilityTest
49+
SWIFT_OPENAPI_COMPATIBILITY_TEST_PARALLEL_CODEGEN: "true"
50+
SWIFT_OPENAPI_COMPATIBILITY_TEST_NUM_BUILD_JOBS: 1
51+
run: swift test --filter ${SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER}
3352

34-
compatibility-test:
35-
name: Compatibility test
36-
runs-on: ubuntu-latest
37-
container:
38-
image: swift:latest
39-
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
42-
with:
43-
persist-credentials: false
44-
- name: Run OpenAPI document compatibilty test
45-
env:
46-
SWIFT_OPENAPI_COMPATIBILITY_TEST_ENABLE: "true"
47-
SWIFT_OPENAPI_COMPATIBILITY_TEST_SKIP_BUILD: "true"
48-
SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER: OpenAPIGeneratorReferenceTests.CompatibilityTest
49-
SWIFT_OPENAPI_COMPATIBILITY_TEST_PARALLEL_CODEGEN: "true"
50-
SWIFT_OPENAPI_COMPATIBILITY_TEST_NUM_BUILD_JOBS: 1
51-
run: swift test --filter ${SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER}
53+
example-packages:
54+
name: Example packages
55+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
56+
with:
57+
name: "Example packages"
58+
matrix_linux_command: "./scripts/test-examples.sh"
59+
matrix_linux_nightly_main_enabled: false
5260

53-
example-packages:
54-
name: Example packages
55-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
56-
with:
57-
name: "Example packages"
58-
matrix_linux_command: "./scripts/test-examples.sh"
59-
matrix_linux_nightly_main_enabled: false
61+
macos-tests:
62+
name: macOS tests
63+
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
64+
with:
65+
runner_pool: general
66+
build_scheme: swift-openapi-generator-Package
67+
ios_xcode_build_enabled: false
68+
watchos_xcode_build_enabled: false
69+
tvos_xcode_build_enabled: false
70+
visionos_xcode_build_enabled: false

0 commit comments

Comments
 (0)