Skip to content

Commit 08fe5c4

Browse files
authored
Constraint CI scripts are now separated out (#10404)
Part of #10368
1 parent db446f2 commit 08fe5c4

File tree

3 files changed

+74
-26
lines changed

3 files changed

+74
-26
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -569,17 +569,7 @@ jobs:
569569
steps:
570570
- name: "Set constraints branch name"
571571
id: constraints-branch
572-
run: |
573-
if [[ ${GITHUB_REF} == 'refs/heads/master' ]]; then
574-
echo "::set-output name=branch::constraints-master"
575-
elif [[ ${GITHUB_REF} == 'refs/heads/v1-10-test' ]]; then
576-
echo "::set-output name=branch::constraints-1-10"
577-
else
578-
echo
579-
echo "Unexpected ref ${GITHUB_REF}. Exiting!"
580-
echo
581-
exit 1
582-
fi
572+
run: ./scripts/ci/constraints/ci_branch_constraints.sh
583573
- uses: actions/checkout@v2
584574
with:
585575
path: "repo"
@@ -589,21 +579,7 @@ jobs:
589579
path: 'artifacts'
590580
name: "Get all artifacts (constraints)"
591581
- name: "Commit changed constraint files"
592-
run: |
593-
cp -v ./artifacts/constraints-*/constraints*.txt repo/
594-
cd repo
595-
git config --local user.email "[email protected]"
596-
git config --local user.name "Automated Github Actions commit"
597-
git diff --exit-code || git commit --all --message "Updating constraints. GH run id:${GITHUB_RUN_ID}
598-
599-
This update in constraints is automatically committed by the CI 'constraints-push' step based on
600-
HEAD of '${GITHUB_REF}' in '${GITHUB_REPOSITORY}'
601-
with commit sha ${GITHUB_SHA}.
602-
603-
All tests passed in this build so we determined we can push the updated constraints.
604-
605-
See https://github.com/apache/airflow/blob/master/README.md#installing-from-pypi for details.
606-
"
582+
run: ./scripts/ci/constraints/ci_commit_constraints.sh
607583
- name: Push changes
608584
uses: ad-m/github-push-action@master
609585
with:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
export PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:-3.6}
19+
20+
# shellcheck source=scripts/ci/libraries/_script_init.sh
21+
. "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"
22+
23+
get_environment_for_builds_on_ci
24+
25+
if [[ ${GITHUB_REF} == 'refs/heads/master' ]]; then
26+
echo "::set-output name=branch::constraints-master"
27+
elif [[ ${GITHUB_REF} == 'refs/heads/v1-10-test' ]]; then
28+
echo "::set-output name=branch::constraints-1-10"
29+
else
30+
echo
31+
echo "Unexpected ref ${GITHUB_REF}. Exiting!"
32+
echo
33+
exit 1
34+
fi
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
export PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:-3.6}
19+
20+
# shellcheck source=scripts/ci/libraries/_script_init.sh
21+
. "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"
22+
23+
get_environment_for_builds_on_ci
24+
25+
cp -v ./artifacts/constraints-*/constraints*.txt repo/
26+
cd repo || exit 1
27+
git config --local user.email "[email protected]"
28+
git config --local user.name "Automated Github Actions commit"
29+
git diff --exit-code || git commit --all --message "Updating constraints. Build id:${CI_BUILD_ID}
30+
31+
This update in constraints is automatically committed by the CI 'constraints-push' step based on
32+
HEAD of '${CI_REF}' in '${CI_TARGET_REPO}'
33+
with commit sha ${COMMIT_SHA}.
34+
35+
All tests passed in this build so we determined we can push the updated constraints.
36+
37+
See https://github.com/apache/airflow/blob/master/README.md#installing-from-pypi for details.
38+
"

0 commit comments

Comments
 (0)