Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align workflows with upstream #328

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/build-and-test-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
GOPROXY: https://goproxy1.cncf.selfactuated.dev,direct

# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616
concurrency:
Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:
- cmd-1
- other
timeout-minutes: 30
runs-on: actuated-arm64-4cpu-4gb
runs-on: otel-linux-arm64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -61,7 +60,7 @@ jobs:
path: |
~/go/bin
~/go/pkg/mod
key: go-build-cache-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: go-build-cache-otel-linux-arm64-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand All @@ -72,7 +71,7 @@ jobs:
run: make -j2 gotest GROUP=${{ matrix.group }}
arm-unittest:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run ARM') || github.event_name == 'push' || github.event_name == 'merge_group') }}
runs-on: actuated-arm64-4cpu-4gb
runs-on: ubuntu-latest
needs: [arm-unittest-matrix]
steps:
- name: Print result
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/build-and-test-darwin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: build-and-test-darwin
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
merge_group:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
env:
TEST_RESULTS: testbed/tests/results/junit/results.xml
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2

# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
darwin-build-unittest-binary:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
runs-on: macos-14
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "~1.22.5"
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-build-cache-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Build test binaries
env:
GOTESTARCH: amd64
run: make gobuildtest GROUP=cgo
- name: Zip test binaries
run: zip -r testbinaries.zip . --include \*builtunitetest.test
- uses: actions/upload-artifact@v4
with:
name: testbinaries
path: ./testbinaries.zip
retention-days: 1
darwin-unittest-matrix:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
needs: [darwin-build-unittest-binary]
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-13]
timeout-minutes: 30
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "~1.22.5"
cache: false
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools
- uses: actions/download-artifact@v4
with:
name: testbinaries
- name: Unzip binaries to each module
run: unzip testbinaries.zip
- name: Run Unit Tests
run: make -j2 gorunbuilttest GROUP=cgo
darwin-unittest:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
runs-on: macos-latest
needs: [darwin-unittest-matrix]
steps:
- name: Print result
run: echo ${{ needs.darwin-unittest-matrix.result }}
- name: Interpret result
run: |
if [[ success == ${{ needs.darwin-unittest-matrix.result }} ]]
then
echo "All matrix jobs passed!"
else
echo "One or more matrix jobs failed."
false
fi
10 changes: 9 additions & 1 deletion .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: Install-WindowsFeature -name Web-Server -IncludeManagementTools
- uses: actions/setup-go@v5
with:
go-version: "1.21.12"
go-version: "1.22.8"
cache: false
- name: Cache Go
id: go-mod-cache
Expand All @@ -69,6 +69,14 @@ jobs:
~\go\pkg\mod
~\AppData\Local\go-build
key: go-build-cache-${{ runner.os }}-${{ matrix.group }}-go-${{ hashFiles('**/go.sum') }}
- name: Ensure required ports in the dynamic range are available
run: |
& ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
- name: Build shared test tools
# If component tests share Makefile targets they need to be added here to avoid
# concurrent component tests clashing when building such targets. This applies
# specifically to Windows, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/34691
run: make "$(${PWD} -replace '\\', '/')/.tools/gotestsum"
- name: Run Unit tests
run: make -j2 gotest GROUP=${{ matrix.group }}
windows-unittest:
Expand Down
Loading
Loading