Add azd ai eval extension for Foundry evaluations #650
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: validate-go-version | |
| on: | |
| pull_request: | |
| paths: | |
| - "**/go.mod" | |
| - "**/Dockerfile" | |
| - ".devcontainer/devcontainer.json" | |
| - "eng/pipelines/templates/steps/setup-go.yml" | |
| - ".github/workflows/validate-go-version.yml" | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-go-version-consistency: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Validate Go version consistency | |
| run: | | |
| # Source of truth: cli/azd/go.mod | |
| EXPECTED=$(grep -m1 '^go ' cli/azd/go.mod | awk '{print $2}') | |
| echo "Expected Go version (from cli/azd/go.mod): $EXPECTED" | |
| ERRORS=0 | |
| # Check all go.mod files | |
| echo "" | |
| echo "Checking go.mod files..." | |
| while IFS= read -r f; do | |
| VERSION=$(grep -m1 '^go ' "$f" | awk '{print $2}') | |
| if [ "$VERSION" != "$EXPECTED" ]; then | |
| echo "::error file=$f::Go version mismatch: found '$VERSION', expected '$EXPECTED'" | |
| ERRORS=$((ERRORS + 1)) | |
| else | |
| echo " OK: $f ($VERSION)" | |
| fi | |
| done < <(find cli/azd -name 'go.mod') | |
| # Check ADO pipeline template | |
| echo "" | |
| echo "Checking ADO pipeline template..." | |
| ADO_FILE="eng/pipelines/templates/steps/setup-go.yml" | |
| if [ -f "$ADO_FILE" ]; then | |
| ADO_VERSION=$(grep -m1 'GoVersion:' "$ADO_FILE" | awk '{print $2}') | |
| if [ "$ADO_VERSION" != "$EXPECTED" ]; then | |
| echo "::error file=$ADO_FILE::GoVersion mismatch: found '$ADO_VERSION', expected '$EXPECTED'" | |
| ERRORS=$((ERRORS + 1)) | |
| else | |
| echo " OK: $ADO_FILE ($ADO_VERSION)" | |
| fi | |
| fi | |
| # Check Dockerfiles referencing golang:<version> base images | |
| echo "" | |
| echo "Checking Dockerfiles..." | |
| while IFS= read -r f; do | |
| DOCKER_VERSION=$(grep -oP 'golang:\K[\d.]+' "$f" | head -1) | |
| if [ -n "$DOCKER_VERSION" ] && [ "$DOCKER_VERSION" != "$EXPECTED" ]; then | |
| echo "::error file=$f::Dockerfile golang version mismatch: found '$DOCKER_VERSION', expected '$EXPECTED'" | |
| ERRORS=$((ERRORS + 1)) | |
| elif [ -n "$DOCKER_VERSION" ]; then | |
| echo " OK: $f (golang:$DOCKER_VERSION)" | |
| fi | |
| done < <(find cli/azd -name 'Dockerfile') | |
| # Check devcontainer.json Go feature version | |
| echo "" | |
| echo "Checking devcontainer.json..." | |
| DEVCONTAINER=".devcontainer/devcontainer.json" | |
| if [ -f "$DEVCONTAINER" ]; then | |
| DC_VERSION=$(grep -A1 'devcontainers/features/go' "$DEVCONTAINER" | grep -oP '"version":\s*"\K[\d.]+') | |
| if [ -n "$DC_VERSION" ] && [ "$DC_VERSION" != "$EXPECTED" ]; then | |
| echo "::error file=$DEVCONTAINER::devcontainer Go version mismatch: found '$DC_VERSION', expected '$EXPECTED'" | |
| ERRORS=$((ERRORS + 1)) | |
| elif [ -n "$DC_VERSION" ]; then | |
| echo " OK: $DEVCONTAINER ($DC_VERSION)" | |
| fi | |
| fi | |
| echo "" | |
| if [ "$ERRORS" -gt 0 ]; then | |
| echo "::error::$ERRORS Go version mismatch(es) found. Run 'cd cli/azd && mage updateGoVersion $EXPECTED' to fix." | |
| exit 1 | |
| fi | |
| echo "All Go versions are consistent ($EXPECTED)." |