Skip to content
Closed
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
6 changes: 4 additions & 2 deletions .github/workflows/build-downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
git clone $GITHUB_PATH $OUTPUT_PATH --branch $BASE_BRANCH
}

GH_REPO="${{ inputs.repo }}"
GH_REPO="${INPUTS_REPO}"
if [ "$GH_REPO" == "docs-examples" ] && [ "$BASE_BRANCH" == "main" ]; then
BASE_BRANCH="master"
fi
Expand Down Expand Up @@ -106,9 +106,11 @@ jobs:
fi

(current_dir=$(pwd) && cd $OUTPUT_PATH && zip -r "$current_dir/output.zip" .)
env:
INPUTS_REPO: ${{ inputs.repo }}

- name: Upload built artifacts
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: artifact-${{ inputs.repo }}
path: output.zip
path: output.zip
14 changes: 8 additions & 6 deletions .github/workflows/magic-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
cd repo
git config user.name "modular-magician"
git config user.email "magic-modules@google.com"
git fetch origin ${{ github.base_ref }} # Fetch the base branch
git merge --no-ff origin/${{ github.base_ref }} # Merge with the base branch
yamlfiles=$(git diff --name-only origin/${{ github.base_ref }} -- mmv1/products) # Compare with the base branch
git fetch origin ${GITHUB_BASE_REF} # Fetch the base branch
git merge --no-ff origin/${GITHUB_BASE_REF} # Merge with the base branch
yamlfiles=$(git diff --name-only origin/${GITHUB_BASE_REF} -- mmv1/products) # Compare with the base branch
if [ ! -z "$yamlfiles" ]; then
echo "yamlfiles=repo/${yamlfiles//$'\n'/ repo/}" >> $GITHUB_OUTPUT
fi
Expand All @@ -31,7 +31,9 @@ jobs:
run: pip install yamllint
- name: Lint YAML files
if: ${{ !failure() && steps.pull_request.outputs.yamlfiles != '' }}
run: yamllint -c repo/.yamllint ${{steps.pull_request.outputs.yamlfiles}}
run: yamllint -c repo/.yamllint ${STEPS_PULL_REQUEST_OUTPUTS_YAMLFILES}
env:
STEPS_PULL_REQUEST_OUTPUTS_YAMLFILES: ${{steps.pull_request.outputs.yamlfiles}}
rake-tests:
runs-on: ubuntu-22.04
steps:
Expand All @@ -46,8 +48,8 @@ jobs:
cd repo
git config user.name "modular-magician"
git config user.email "magic-modules@google.com"
git fetch origin ${{ github.base_ref }} # Fetch the base branch
git merge --no-ff origin/${{ github.base_ref }} # Merge with the base branch
git fetch origin ${GITHUB_BASE_REF} # Fetch the base branch
git merge --no-ff origin/${GITHUB_BASE_REF} # Merge with the base branch
- name: Set up Ruby
uses: ruby/setup-ruby@036ef458ddccddb148a2b9fb67e95a22fdbf728b # v1.160.0
with:
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/test-tgc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ jobs:
run: |
curl -X POST -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${{github.event.inputs.sha}}" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${GITHUB_EVENT_INPUTS_SHA}" \
-d '{
"context": "${{ github.event.inputs.repo }}${{ env.status_suffix }}",
"target_url": "${{ steps.get_job.outputs.url }}",
"context": "${GITHUB_EVENT_INPUTS_REPO}${{ env.status_suffix }}",
"target_url": "${STEPS_GET_JOB_OUTPUTS_URL}",
"state": "pending"
}'
env:
GITHUB_EVENT_INPUTS_SHA: ${{github.event.inputs.sha}}
GITHUB_EVENT_INPUTS_REPO: ${{ github.event.inputs.repo }}
STEPS_GET_JOB_OUTPUTS_URL: ${{ steps.get_job.outputs.url }}
- name: Checkout Repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -84,9 +88,12 @@ jobs:
- name: Build Terraform Google Conversion
if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }}
run: |
go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/${{ github.event.inputs.owner }}/terraform-provider-google-beta@${{ github.event.inputs.branch }}
go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/${GITHUB_EVENT_INPUTS_OWNER}/terraform-provider-google-beta@${GITHUB_EVENT_INPUTS_BRANCH}
go mod tidy
make build
env:
GITHUB_EVENT_INPUTS_OWNER: ${{ github.event.inputs.owner }}
GITHUB_EVENT_INPUTS_BRANCH: ${{ github.event.inputs.branch }}
- name: Run Unit Tests
if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }}
run: |
Expand All @@ -96,9 +103,14 @@ jobs:
run: |
curl -X POST -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${{github.event.inputs.sha}}" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${GITHUB_EVENT_INPUTS_SHA}" \
-d '{
"context": "${{ github.event.inputs.repo }}${{ env.status_suffix }}",
"target_url": "${{ steps.get_job.outputs.url }}",
"state": "${{ job.status }}"
"context": "${GITHUB_EVENT_INPUTS_REPO}${{ env.status_suffix }}",
"target_url": "${STEPS_GET_JOB_OUTPUTS_URL}",
"state": "${JOB_STATUS}"
}'
env:
GITHUB_EVENT_INPUTS_SHA: ${{github.event.inputs.sha}}
GITHUB_EVENT_INPUTS_REPO: ${{ github.event.inputs.repo }}
STEPS_GET_JOB_OUTPUTS_URL: ${{ steps.get_job.outputs.url }}
JOB_STATUS: ${{ job.status }}
23 changes: 16 additions & 7 deletions .github/workflows/test-tpg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ jobs:
run: |
curl -X POST -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${{github.event.inputs.sha}}" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${GITHUB_EVENT_INPUTS_SHA}" \
-d '{
"context": "${{ github.event.inputs.repo }}${{ env.status_suffix }}",
"target_url": "${{ steps.get_job.outputs.url }}",
"context": "${GITHUB_EVENT_INPUTS_REPO}${{ env.status_suffix }}",
"target_url": "${STEPS_GET_JOB_OUTPUTS_URL}",
"state": "pending"
}'
env:
GITHUB_EVENT_INPUTS_SHA: ${{github.event.inputs.sha}}
GITHUB_EVENT_INPUTS_REPO: ${{ github.event.inputs.repo }}
STEPS_GET_JOB_OUTPUTS_URL: ${{ steps.get_job.outputs.url }}
- name: Checkout Repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -92,9 +96,14 @@ jobs:
run: |
curl -X POST -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${{github.event.inputs.sha}}" \
"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/${GITHUB_EVENT_INPUTS_SHA}" \
-d '{
"context": "${{ github.event.inputs.repo }}${{ env.status_suffix }}",
"target_url": "${{ steps.get_job.outputs.url }}",
"state": "${{ job.status }}"
"context": "${GITHUB_EVENT_INPUTS_REPO}${{ env.status_suffix }}",
"target_url": "${STEPS_GET_JOB_OUTPUTS_URL}",
"state": "${JOB_STATUS}"
}'
env:
GITHUB_EVENT_INPUTS_SHA: ${{github.event.inputs.sha}}
GITHUB_EVENT_INPUTS_REPO: ${{ github.event.inputs.repo }}
STEPS_GET_JOB_OUTPUTS_URL: ${{ steps.get_job.outputs.url }}
JOB_STATUS: ${{ job.status }}
Loading