diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f2ef39aa..d77d83fcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,10 +60,10 @@ jobs: esac - name: Build working-directory: main - run: make build + run: make build "SWIFT_BUILD_TEST_HOOK=-Xswiftc -warnings-as-errors" - name: Test runtime working-directory: main - run: make test-runtime + run: make test-runtime "SWIFT_BUILD_TEST_HOOK=-Xswiftc -warnings-as-errors" - name: Cache protobuf id: cache-protobuf uses: actions/cache@v3 diff --git a/Makefile b/Makefile index f797ad48f..8c7eee166 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,9 @@ SWIFT_CONFORMANCE_PLUGIN=.build/debug/Conformance # override this value. CONFORMANCE_TEST_RUNNER?=${GOOGLE_PROTOBUF_CHECKOUT}/conformance_test_runner +# Hook to pass arge to swift build|test (mainly for the CI setup) +SWIFT_BUILD_TEST_HOOK?= + # The directories within Protos/ with the exception of "upstream". Use for the # maintenance of the 'Reference' target and test-plugin. PROTOS_DIRS=Conformance protoc-gen-swiftTests SwiftProtobuf SwiftProtobufPluginLibrary SwiftProtobufPluginLibraryTests SwiftProtobufTests @@ -98,7 +101,7 @@ all: build # Builds all the targets of the package. build: - ${SWIFT} build + ${SWIFT} build ${SWIFT_BUILD_TEST_HOOK} # Anything that needs the plugin should do a build. ${PROTOC_GEN_SWIFT}: build @@ -143,7 +146,7 @@ check-version-numbers: # and functional tests for the Swift code generated by the plugin. # test-runtime: build - ${SWIFT} test + ${SWIFT} test ${SWIFT_BUILD_TEST_HOOK} # # Test the plugin by itself: