Skip to content

Commit

Permalink
chore: move all GHAs to ubuntu-22.04
Browse files Browse the repository at this point in the history
GHA doesn't really offer a great way to make this DRY, but that doesn't mean we can't be consistent and deterministic. Ideally we'd set our preferred ubuntu version centrally and change it all at once, but it's really not hard to mass update this.

I got GPT to write a quick script to replace in files for reference:

```python
import os

def replace_strings_in_file(file_path, old_string, new_string):
    with open(file_path, 'r') as file:
        content = file.read()

    content = content.replace(old_string, new_string)

    with open(file_path, 'w') as file:
        file.write(content)

def update_github_workflows(directory='.github/workflows', old_string1='ubuntu-20.04', old_string2='ubuntu-latest', new_string='ubuntu-22.04'):
    for subdir, _, files in os.walk(directory):
        for file in files:
            file_path = os.path.join(subdir, file)
            if file_path.endswith('.yml') or file_path.endswith('.yaml'):
                replace_strings_in_file(file_path, old_string1, new_string)
                replace_strings_in_file(file_path, old_string2, new_string)
                print(f"Updated {file_path}")

if __name__ == "__main__":
    update_github_workflows()
```
  • Loading branch information
mistercrunch committed Jul 1, 2024
1 parent 0286650 commit c06c4a6
Show file tree
Hide file tree
Showing 39 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bump-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
bump-python-package:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: write
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cancel_duplicates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
cancel-duplicate-runs:
name: Cancel duplicate workflow runs
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
actions: write
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_db_migration_confict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:
jobs:
check_db_migration_conflict:
name: Check DB migration conflict
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
dependency-review:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
setup_matrix:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
matrix_config: ${{ steps.set_matrix.outputs.matrix_config }}
steps:
Expand All @@ -28,7 +28,7 @@ jobs:
docker-build:
name: docker-build
needs: setup_matrix
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
build_preset: ${{fromJson(needs.setup_matrix.outputs.matrix_config)}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/embedded-sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -23,7 +23,7 @@ jobs:
build:
needs: config
if: needs.config.outputs.has-secrets
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
defaults:
run:
working-directory: superset-embedded-sdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/embedded-sdk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
embedded-sdk-test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
defaults:
run:
working-directory: superset-embedded-sdk
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ephemeral-env-pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -22,7 +22,7 @@ jobs:
needs: config
if: needs.config.outputs.has-secrets
name: Cleanup ephemeral envs
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ephemeral-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
if: github.event.issue.pull_request
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
Expand All @@ -26,7 +26,7 @@ jobs:
needs: config
if: needs.config.outputs.has-secrets
name: Evaluate ephemeral env comment trigger (/testenv)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
pull-requests: write
outputs:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
cancel-in-progress: true
needs: ephemeral-env-comment
name: ephemeral-docker-build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Get Info from comment
uses: actions/github-script@v7
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
needs: [ephemeral-env-comment, ephemeral-docker-build]
if: needs.ephemeral-env-comment.outputs.slash-command == 'up'
name: Spin up an ephemeral environment
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-FOSSA-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -24,7 +24,7 @@ jobs:
needs: config
if: needs.config.outputs.has-secrets
name: Generate Report
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-action-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:

validate-all-ghas:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue_creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
superbot-orglabel:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/labeler@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
latest-release:
name: Add/update tag to new release
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
jobs:
license_check:
name: License Check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/no-hold-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:

jobs:
check-hold-label:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check for 'hold' label
uses: actions/github-script@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
lint-check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
pre-commit:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prefer-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
prefer_typescript:
if: github.ref == 'ref/heads/master' && github.event_name == 'pull_request'
name: Prefer TypeScript
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -25,7 +25,7 @@ jobs:
if: needs.config.outputs.has-secrets
name: Bump version and publish package(s)

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/superset-applitool-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -21,7 +21,7 @@ jobs:
cypress-applitools:
needs: config
if: needs.config.outputs.has-secrets
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/superset-applitools-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -27,7 +27,7 @@ jobs:
cron:
needs: config
if: needs.config.outputs.has-secrets
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
node: [18]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
test-load-examples:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PYTHONPATH: ${{ github.workspace }}
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/superset-docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
config:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
Expand All @@ -28,7 +28,7 @@ jobs:
needs: config
if: needs.config.outputs.has-secrets
name: Build & Deploy
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-docs-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
build-deploy:
name: Build & Deploy
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
defaults:
run:
working-directory: docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:

jobs:
cypress-matrix:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
frontend-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-helm-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
lint-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/superset-python-integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
test-mysql:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PYTHONPATH: ${{ github.workspace }}
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
test-postgres:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["current", "next", "previous"]
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
verbose: true

test-sqlite:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PYTHONPATH: ${{ github.workspace }}
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
Expand Down
Loading

0 comments on commit c06c4a6

Please sign in to comment.