Skip to content

Commit

Permalink
[chore] Fix naming, add second smoketest (#5515)
Browse files Browse the repository at this point in the history
* Fix naming and add another smoketest for packaging the TA as we do for releases

* restrict build context

* Also build the TA distribution target on changes to the TA workflow

* handle push events too

* bump checkout actions version
  • Loading branch information
hughesjj authored Oct 16, 2024
1 parent 8ac9025 commit fe57729
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions .github/workflows/splunk-ta-otel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ env:
jobs:
setup-environment:
name: setup-environment
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
Expand All @@ -43,8 +42,7 @@ jobs:
test:
name: test
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Check out the codebase.
Expand All @@ -60,3 +58,51 @@ jobs:
run: |
set -o pipefail
make -e package-technical-addon
check_changes:
runs-on: ubuntu-latest
outputs:
ta_packaging_change: ${{ steps.filter.outputs.ta_packaging_change }}
ta_workflow_change: ${{ steps.filter.outputs.ta_workflow_change }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Get changed files
id: changed-files
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "files=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
else
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
fi
- name: Filter paths
id: filter
run: |
files="${{ steps.changed-files.outputs.files }}"
if echo "$files" | grep -qE "packaging/technical-addon"; then
echo "ta_packaging_change=true" >> $GITHUB_OUTPUT
else
echo "ta_packaging_change=false" >> $GITHUB_OUTPUT
fi
if echo "$files" | grep -qE ".github/workflows/splunk-ta-otel.yml"; then
echo "ta_workflow_change=true" >> $GITHUB_OUTPUT
else
echo "ta_workflow_change=false" >> $GITHUB_OUTPUT
fi
distribute-ta:
name: "distribute-ta" # what gets run to package in gitlab
runs-on: ubuntu-latest
needs: [setup-environment, check_changes]
if: needs.check_changes.outputs.ta_packaging_change == 'true' || needs.check_changes.outputs.ta_workflow_change == 'true'
steps:
- name: Check out the codebase.
uses: actions/checkout@v4

- name: Build & Package TA
run: |
set -o pipefail
PLATFORM="all" make -e distribute-ta

0 comments on commit fe57729

Please sign in to comment.