Skip to content

Commit

Permalink
Split build and integration test into separate jobs (#2569)
Browse files Browse the repository at this point in the history
Avoid unnecessary rebuilds when re-running failed tests.
  • Loading branch information
jeffreyc-splunk authored Feb 16, 2023
1 parent 75eb94f commit 37e424b
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ concurrency:
group: integration-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GO_VERSION: "1.19.4"

jobs:
docker-otelcol:
name: docker-otelcol
Expand All @@ -31,7 +34,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.4
go-version: ${{ env.GO_VERSION }}
- id: module-cache
uses: actions/cache@v3
env:
Expand All @@ -44,7 +47,39 @@ jobs:
- run: make docker-otelcol
env:
DOCKER_BUILDKIT: '1'
- run: docker save -o ./bin/image.tar otelcol:latest
- uses: actions/upload-artifact@v3
with:
name: otelcol
path: ./bin

integration-test:
name: integration-test
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
needs: [docker-otelcol]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- id: module-cache
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
- uses: actions/download-artifact@v3
with:
name: otelcol
path: ./bin
- run: docker load -i ./bin/image.tar
- run: chmod a+x ./bin/*
- run: make integration-test
env:
SPLUNK_OTEL_COLLECTOR_IMAGE: 'otelcol:latest'

0 comments on commit 37e424b

Please sign in to comment.