| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, | |
| # software distributed under the License is distributed on an | |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| # KIND, either express or implied. See the License for the | |
| # specific language governing permissions and limitations | |
| # under the License. | |
| name: Clean Up GCP Resources | |
| on: | |
| schedule: | |
| - cron: '0 0,12 * * *' | |
| workflow_dispatch: | |
| # This allows a subsequently queued workflow run to interrupt previous runs | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.sender.login }}' | |
| cancel-in-progress: true | |
| env: | |
| DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
| GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }} | |
| GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }} | |
| # Setting explicit permissions for the action | |
| permissions: | |
| actions: write | |
| pull-requests: read | |
| checks: read | |
| contents: read | |
| deployments: read | |
| id-token: none | |
| issues: read | |
| discussions: read | |
| packages: read | |
| pages: read | |
| repository-projects: read | |
| security-events: read | |
| statuses: read | |
| jobs: | |
| beam_CleanUpGCPResources: | |
| name: ${{ matrix.job_name }} | |
| runs-on: [self-hosted, ubuntu-24.04, main] | |
| timeout-minutes: 100 | |
| strategy: | |
| matrix: | |
| job_name: [beam_CleanUpGCPResources] | |
| if: | | |
| (github.event_name == 'schedule' && github.repository == 'apache/beam') || | |
| github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Setup repository | |
| uses: ./.github/actions/setup-action | |
| - name: Setup environment | |
| uses: ./.github/actions/setup-environment-action | |
| with: | |
| disable-cache: true | |
| python-version: default | |
| - name: Setup gcloud | |
| uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db | |
| - name: Install gcloud bigtable cli | |
| run: gcloud components install cbt | |
| - name: run cleanup GCP resources | |
| uses: ./.github/actions/gradle-command-self-hosted-action | |
| with: | |
| gradle-command: :beam-test-tools:cleanupOtherStaleResources |