From 0e4965e8ee0a72e3833d6d55bb49234084ea870c Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Sat, 9 Nov 2024 17:37:34 -0800 Subject: [PATCH] Add cgolessbuild test job (#210) * Add cgolessbuild test job * Clarify cgoless job description --- .github/workflows/test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a785666..6c213bcc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,3 +97,23 @@ jobs: uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Run Test run: go test -v ./... + + # Verify that golang-fips/openssl builds successfully without cgo enabled. + # + # A project can avoid attempting to build the openssl package by only + # importing it from Go files with a cgo build tag. However, this isn't always + # reasonable. In that case, we can help by making sure the openssl package + # builds successfully even without cgo. + # + # For example, the Microsoft Go toolset fork builds this module without cgo + # for a cross-platform build. + # + # The golang-fips/openssl module can't do any crypto when built without cgo, + # but it exports a few simple functions and types. + cgolessbuild: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Run Build + run: CGO_ENABLED=0 go build ./...