forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-34331][ci] Adds reusable workflow that is used to load the run…
…ner configuration based on the projects owner The goal is to enable Apache-hosted runners for the main repo but allow forks to use the GitHub-hosted runners.
- Loading branch information
Showing
3 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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: "Apache Flink Workflow Initialization" | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
runner_config: | ||
description: "The runs-on configuration that can be used in the runs-on parameter." | ||
value: ${{ jobs.workflow_init.outputs.runner_config }} | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
workflow_init: | ||
name: "Initialize Workflow" | ||
# no need to fix a specific ubuntu version here because the workflow only | ||
# runs shell scripts that do not require dependency stability | ||
runs-on: ubuntu-latest | ||
outputs: | ||
runner_config: ${{ steps.runner_config_provider.outputs.runner_config }} | ||
steps: | ||
- name: "Determine runner configuration" | ||
id: runner_config_provider | ||
shell: bash | ||
run: | | ||
runner_config_value="\"ubuntu-22.04\"" | ||
if [[ "${GITHUB_REPOSITORY_OWNER}" == "apache" ]]; then | ||
runner_config_value='["self-hosted", "asf-runner"]' | ||
fi | ||
echo "runner_config=${runner_config_value}" >> "${GITHUB_OUTPUT}" |