feat(gcp): add network tags support for peer pod VMs #12
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
| # (C) Copyright Confidential Containers Contributors | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| # Validate config-extractor tool and check for drift in generated files | |
| --- | |
| name: validate-config-extractor | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/cloud-providers/**/manager.go' | |
| - 'src/cloud-providers/util.go' | |
| - 'src/cloud-providers/cmd/config-extractor/**' | |
| - 'src/cloud-providers/Makefile' | |
| - 'src/cloud-api-adaptor/install/charts/peerpods/providers/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| test-extractor: | |
| name: Test config-extractor tool | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: src/cloud-providers | |
| steps: | |
| - name: Checkout the pull request code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Read properties from versions.yaml | |
| run: | | |
| go_version="$(yq '.tools.golang' ../cloud-api-adaptor/versions.yaml)" | |
| [ -n "$go_version" ] | |
| echo "GO_VERSION=${go_version}" >> "$GITHUB_ENV" | |
| - name: Setup Golang version ${{ env.GO_VERSION }} | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache-dependency-path: "**/go.sum" | |
| cache: false | |
| - name: Build config-extractor | |
| run: make config-extractor | |
| - name: Test all providers parse successfully | |
| run: | | |
| # Find all directories with manager.go (excluding cmd and util) | |
| for provider_dir in */; do | |
| provider=$(basename "$provider_dir") | |
| # Skip non-provider directories | |
| if [[ "$provider" == "cmd" || "$provider" == "util" || "$provider" == "bin" ]]; then | |
| continue | |
| fi | |
| # Check if manager.go exists | |
| if [[ ! -f "${provider}/manager.go" ]]; then | |
| echo "Error: ${provider}/manager.go not found" | |
| echo "This could indicate a refactoring issue or incomplete provider implementation" | |
| exit 1 | |
| fi | |
| echo "::group::Testing provider: $provider" | |
| ./bin/config-extractor -o json "$provider" > /tmp/"$provider".json | |
| # Verify output is valid JSON | |
| if ! jq empty /tmp/"$provider".json 2>/dev/null; then | |
| echo "Invalid JSON output for $provider" | |
| exit 1 | |
| fi | |
| # Verify at least some flags were extracted | |
| flag_count=$(jq '.flags | length' /tmp/"$provider".json) | |
| echo "[OK] $provider: parsed successfully ($flag_count flags found)" | |
| echo "::endgroup::" | |
| done | |
| shell: bash | |
| - name: Check for drift in generated chart values | |
| run: | | |
| echo "Regenerating chart values to check for drift..." | |
| make sync-chart-values | |
| # Check if any files changed | |
| if git diff --exit-code ../cloud-api-adaptor/install/charts/peerpods/providers/; then | |
| echo "[OK] Generated files are up to date" | |
| else | |
| echo "::error::Generated chart values are out of sync!" | |
| echo "" | |
| echo "The provider YAML files in install/charts/peerpods/providers/ do not match" | |
| echo "what would be generated from the current manager.go files." | |
| echo "" | |
| echo "To fix this, run:" | |
| echo " cd src/cloud-providers && make sync-chart-values" | |
| echo "" | |
| echo "Then commit the updated files." | |
| exit 1 | |
| fi |