Skip to content
Merged
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/scripts/build-azure-monitor-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

set -e

echo "Building azure-monitor-opentelemetry-autoconfigure from $AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE"
echo "Building azure-monitor-opentelemetry-autoconfigure from $AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT"

# Parse repo and branch from format "owner/repo:branch"
REPO_BRANCH="$AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE"
REPO_BRANCH="$AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT"
REPO=$(echo "$REPO_BRANCH" | cut -d':' -f1)
BRANCH=$(echo "$REPO_BRANCH" | cut -d':' -f2)

Expand All @@ -17,9 +17,8 @@ echo "Branch: $BRANCH"

# Clone the repository
echo "Cloning repository..."
git clone https://github.com/$REPO.git azure-sdk-temp
git clone --depth 1 --branch $BRANCH https://github.com/$REPO.git azure-sdk-temp
cd azure-sdk-temp
git checkout $BRANCH

# Build and install the azure-monitor-opentelemetry-autoconfigure module
echo "Building and installing azure-monitor-opentelemetry-autoconfigure..."
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
# set this to <repo>:<branch/sha> to build and test with an unreleased
# version of the azure-monitor-opentelemetry-autoconfigure dependency
AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE:
AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT:

jobs:
spotless:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
java-version: 17

- name: Build and install local azure-monitor-opentelemetry-autoconfigure dependency
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE != ''
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT != ''
run: ./.github/scripts/build-azure-monitor-dependency.sh

- name: Setup Gradle
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
java-version: 17

- name: Build and install local azure-monitor-opentelemetry-autoconfigure dependency
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE != ''
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT != ''
shell: bash
run: ./.github/scripts/build-azure-monitor-dependency.sh

Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
java-version: 17

- name: Build and install local azure-monitor-opentelemetry-autoconfigure dependency
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE != ''
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT != ''
shell: bash
run: ./.github/scripts/build-azure-monitor-dependency.sh

Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
java-version: 17

- name: Build and install local azure-monitor-opentelemetry-autoconfigure dependency
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE != ''
if: env.AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT != ''
run: ./.github/scripts/build-azure-monitor-dependency.sh

- name: Setup Gradle
Expand All @@ -259,3 +259,14 @@ jobs:
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: '**/build/reports/tests/smokeTest/**/*'

check-snapshot-dependency:
runs-on: ubuntu-latest
steps:
- name: Check for snapshot dependency
run: |
if [[ -n "$AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT" ]]; then
echo "AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT is set to '$AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT'"
echo "PRs testing against a snapshot cannot be merged."
exit 1
fi