diff --git a/.github/workflows/dev_builds.yml b/.github/workflows/dev_builds.yml index 5eebf5a961..860eac3daf 100644 --- a/.github/workflows/dev_builds.yml +++ b/.github/workflows/dev_builds.yml @@ -71,6 +71,9 @@ jobs: include: - arch_os: linux_amd64 runs-on: ubuntu-20.04 + - arch_os: linux_amd64 + runs-on: ubuntu-20.04 + boringcrypto: true - arch_os: darwin_amd64 runs-on: macos-latest - arch_os: windows_amd64 @@ -79,6 +82,7 @@ jobs: arch_os: ${{ matrix.arch_os }} runs-on: ${{ matrix.runs-on }} save-cache: true + boringcrypto: ${{ matrix.boringcrypto == true }} build: name: Build diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index e8f919f015..e0dc83636d 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -124,6 +124,9 @@ jobs: include: - arch_os: linux_amd64 runs-on: ubuntu-20.04 + - arch_os: linux_amd64 + runs-on: ubuntu-20.04 + boringcrypto: true - arch_os: darwin_amd64 runs-on: macos-latest - arch_os: windows_amd64 @@ -132,6 +135,7 @@ jobs: arch_os: ${{ matrix.arch_os }} runs-on: ${{ matrix.runs-on }} only-if-changed: true + boringcrypto: ${{ matrix.boringcrypto == true }} test-install-script: name: Test Install Script @@ -167,48 +171,6 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' run: make test-install-script - - # pipeline to test using Go+BoringCrypto - test-go-boringcrypto: - name: Test BoringCrypto - runs-on: ${{ matrix.runs_on }} - strategy: - matrix: - include: - - arch_os: linux_amd64 - runs_on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: Check if test related files changed - id: changed-files - uses: tj-actions/changed-files@v35 - with: - files: | - **/go.mod - **/go.sum - **/*.go - **/*.yaml - **/*.yml - **/Makefile - **/Makefile.common - scripts/install.sh - - - name: Setup go - if: steps.changed-files.outputs.any_changed == 'true' - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - cache-dependency-path: '**/go.sum' - - - name: Add opentelemetry-collector-builder installation dir to PATH - if: steps.changed-files.outputs.any_changed == 'true' - run: echo "$HOME/bin" >> $GITHUB_PATH - - - name: Run tests - if: steps.changed-files.outputs.any_changed == 'true' - run: make gotest CGO_ENABLED=1 GOEXPERIMENT=boringcrypto - test-wixext: name: Test (SumoLogic.wixext) runs-on: windows-2019 diff --git a/.github/workflows/workflow-test.yml b/.github/workflows/workflow-test.yml index 8d9038fd90..870a4afd33 100644 --- a/.github/workflows/workflow-test.yml +++ b/.github/workflows/workflow-test.yml @@ -7,6 +7,10 @@ on: description: Architecture and OS in the form "{arch}_{os}". See GOARCH and GOOS for accepted values. default: linux_amd64 type: string + boringcrypto: + description: Run with BoringCrypto enabled + default: false + type: boolean runs-on: default: ubuntu-20.04 type: string @@ -30,6 +34,8 @@ jobs: test: name: Test runs-on: ${{ inputs.runs-on }} + env: + BORINGCRYPTO_SUFFIX: ${{ inputs.boringcrypto && '-boringcrypto' || '' }} steps: - uses: actions/checkout@v3 @@ -64,8 +70,8 @@ jobs: id: get-cache-key if: ${{ ! inputs.only-if-changed || steps.changed-files.outputs.any_changed == 'true' }} run: | - echo "cache-key=go-test-${{ env.GO_VERSION }}-${{inputs.arch_os}}${BORINGCRYPTO_SUFFIX}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }}" >> $GITHUB_OUTPUT - echo "restore-keys=go-test-${{ env.GO_VERSION }}-${{inputs.arch_os}}${BORINGCRYPTO_SUFFIX}-" >> $GITHUB_OUTPUT + echo "cache-key=go-test-${{ env.GO_VERSION }}${BORINGCRYPTO_SUFFIX}-${{inputs.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }}" >> $GITHUB_OUTPUT + echo "restore-keys=go-test-${{ env.GO_VERSION }}${BORINGCRYPTO_SUFFIX}-${{inputs.arch_os}}-" >> $GITHUB_OUTPUT - uses: actions/cache/restore@v3 if: ${{ ! inputs.only-if-changed || steps.changed-files.outputs.any_changed == 'true' }} @@ -87,7 +93,7 @@ jobs: - name: Run package tests if: ${{ ! inputs.only-if-changed || steps.changed-files.outputs.any_changed == 'true' }} - run: make gotest + run: make gotest ${{ inputs.boringcrypto && 'CGO_ENABLED=1 GOEXPERIMENT=boringcrypto' || '' }} - uses: actions/cache/save@v3 if: ${{ inputs.save-cache && (! inputs.only-if-changed || steps.changed-files.outputs.any_changed == 'true') }}