You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/01/22 15:49:18 UTC
[airflow] 05/33: Generate constraints in PRs when upgrading dependencies (#20624)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit edc6e42f69db1ee2940927e61aead5705b3e6a88
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Jan 2 15:31:26 2022 +0100
Generate constraints in PRs when upgrading dependencies (#20624)
The constraints generation was only happening in push/scheduled
runs, but sometimes it is useful to check what constraints would
be generated even in the PRs that change setup.py/setup.cfg
The change causes constraint generation also in the PRs and only
pushing the updated constraints is not executed in PRs.
(cherry picked from commit f668fa7aebaf90da4f5da20276e547cf6486fa7c)
---
.github/workflows/ci.yml | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d5d75ad..bb07b25 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1225,8 +1225,7 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
RUNS_ON: ${{ fromJson(needs.build-info.outputs.runsOn) }}
PYTHON_MAJOR_MINOR_VERSION: ${{ matrix.python-version }}
CURRENT_PYTHON_MAJOR_MINOR_VERSIONS_AS_STRING: ${{needs.build-info.outputs.pythonVersionsListAsString}}
- # Only run it for direct pushes and scheduled builds
- if: github.event_name == 'push' || github.event_name == 'schedule'
+ if: needs.build-info.outputs.upgradeToNewerDependencies != 'false'
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
@@ -1263,20 +1262,26 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
- name: "Set constraints branch name"
id: constraints-branch
run: ./scripts/ci/constraints/ci_branch_constraints.sh
- # only actually push it when we are in apache/airflow repository
+ # only actually checkout and push it when we are in apache/airflow repository
- name: Checkout ${{ steps.constraints-branch.outputs.branch }}
uses: actions/checkout@v2
- if: github.repository == 'apache/airflow'
+ if: >
+ github.repository == 'apache/airflow' &&
+ (github.event_name == 'push' || github.event_name == 'schedule')
with:
path: "repo"
ref: ${{ steps.constraints-branch.outputs.branch }}
persist-credentials: false
- name: "Commit changed constraint files for ${{needs.build-info.outputs.pythonVersions}}"
run: ./scripts/ci/constraints/ci_commit_constraints.sh
- if: github.repository == 'apache/airflow'
+ if: >
+ github.repository == 'apache/airflow' &&
+ (github.event_name == 'push' || github.event_name == 'schedule')
- name: "Push changes"
uses: ./.github/actions/github-push-action
- if: github.repository == 'apache/airflow'
+ if: >
+ github.repository == 'apache/airflow' &&
+ (github.event_name == 'push' || github.event_name == 'schedule')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.constraints-branch.outputs.branch }}