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
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@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/pre-build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,22 @@ 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}}
- name: Post Result Status to Pull Request
if: ${{ !cancelled() && steps.pull_request.outputs.yamlfiles != '' }}
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 }}
28 changes: 20 additions & 8 deletions .github/workflows/test-tgc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,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: Set up Go
if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }}
uses: actions/setup-go@v4
Expand All @@ -79,9 +83,12 @@ jobs:
if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }}
run: |
cd tgc
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 @@ -92,9 +99,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 @@ -64,12 +64,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: Set up Go
if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }}
uses: actions/setup-go@v4
Expand Down Expand Up @@ -100,9 +104,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