-
Notifications
You must be signed in to change notification settings - Fork 91
Add minimum dependency generator GitHub Action #2267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
79e34eb
1f05e05
dd938fa
2c07c69
3ca59e7
9290cec
9397f4e
0ad4881
f7cf7ce
9c9fcec
9d712c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: Minimum Dependency Checker | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'requirements.txt' | ||
| - 'test-requirements.txt' | ||
| - 'core-requirements.txt' | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| - name: Run min dep generator - test requirements | ||
| id: min_dep_gen_test | ||
| uses: alteryx/minimum-dependency-generator@v2 | ||
| with: | ||
| requirements_paths: 'test-requirements.txt' | ||
| - name: Save min test requirements and run diff | ||
| id: check_min_test | ||
| continue-on-error: true | ||
| run: | | ||
| mkdir /tmp/dependencies_updated_artifacts | ||
| printf "${{ steps.min_dep_gen_test.outputs.min_reqs }}" > /tmp/minimum_test_requirements.txt | ||
| diff /tmp/minimum_test_requirements.txt evalml/tests/dependency_update_check/minimum_test_requirements.txt | ||
| - name: if min test requirements have changed, write output file | ||
| if: steps.check_min_test.outcome != 'success' | ||
| run: | | ||
| printf "${{ steps.min_dep_gen_test.outputs.min_reqs }}" > evalml/tests/dependency_update_check/minimum_test_requirements.txt | ||
| - name: Run min dep generator - requirements | ||
| id: min_dep_gen_reqs | ||
| uses: alteryx/minimum-dependency-generator@v2 | ||
| with: | ||
| requirements_paths: 'requirements.txt' | ||
| - name: Save min requirements and run diff | ||
| id: check_min_reqs | ||
| continue-on-error: true | ||
| run: | | ||
| printf "${{ steps.min_dep_gen_reqs.outputs.min_reqs }}" > /tmp/minimum_requirements.txt | ||
| diff /tmp/minimum_requirements.txt evalml/tests/dependency_update_check/minimum_requirements.txt | ||
| - name: if min requirements have changed, write output file | ||
| if: steps.check_min_reqs.outcome != 'success' | ||
| run: | | ||
| printf "${{ steps.min_dep_gen_reqs.outputs.min_reqs }}" > evalml/tests/dependency_update_check/minimum_requirements.txt | ||
| - name: Run min dep generator - core requirements | ||
| id: min_dep_gen_core | ||
| uses: alteryx/minimum-dependency-generator@v2 | ||
| with: | ||
| requirements_paths: 'core-requirements.txt' | ||
| - name: Save min core requirements and run diff | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a way in GH actions to define a "function" which could accept an arg like the requirements file name, and then execute the diff and file write, and then we could call that "function" 3x instead of copy-pasting the code, right? Not required for this PR lol just curious |
||
| id: check_core_reqs | ||
| continue-on-error: true | ||
| run: | | ||
| printf "${{ steps.min_dep_gen_core.outputs.min_reqs }}" > /tmp/minimum_core_requirements.txt | ||
| diff /tmp/minimum_core_requirements.txt evalml/tests/dependency_update_check/minimum_core_requirements.txt | ||
| - name: if min core requirements have changed, write output file | ||
| if: steps.check_core_reqs.outcome != 'success' | ||
| run: | | ||
| printf "${{ steps.min_dep_gen_core.outputs.min_reqs }}" > evalml/tests/dependency_update_check/minimum_core_requirements.txt | ||
| - name: Create Pull Request | ||
| uses: FeatureLabs/create-pull-request@v3 | ||
| with: | ||
| token: ${{ secrets.MACHINEFL_DEPENDENCY_CHECKER_TOKEN }} | ||
| commit-message: Update minimum dependencies | ||
| title: Automated Minimum Dependency Updates | ||
| author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
| body: "This is an auto-generated PR with **minimum** dependency updates. | ||
| Please do not delete the `min-dep-update` branch because it's needed by the auto-dependency bot." | ||
| branch: min-dep-update | ||
| branch-suffix: short-commit-hash | ||
| base: main | ||
| reviewers: angela97lin, dsherry, jeremyliweishih, freddyaboulton, bchen1116, chukarsten, ParthivNaresh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,10 @@ jobs: | |
| run: | | ||
| if [[ $(expr match "${{ github.event.pull_request.head.ref }}" "release_v[0-9.]\+") -gt 0 ]]; then | ||
| echo This is a release PR; | ||
| elif [[ $(expr match "${{ github.event.pull_request.head.ref }}" "dep-update-[a-zA-Z0-9]*") -gt 0 ]]; then | ||
| echo This is a dependency update PR; | ||
| elif [[ $(expr match "${{ github.event.pull_request.head.ref }}" "latest-dep-update-[a-zA-Z0-9]*") -gt 0 ]]; then | ||
| echo This is a latest dependency update PR; | ||
| elif [[ $(expr match "${{ github.event.pull_request.head.ref }}" "min-dep-update-[a-zA-Z0-9]*") -gt 0 ]]; then | ||
| echo This is a minimum dependency update PR; | ||
| else | ||
| echo This is a regular PR; | ||
| fi | ||
|
|
@@ -28,7 +30,9 @@ jobs: | |
| run: | | ||
| if [[ $(expr match "${{ github.event.pull_request.head.ref }}" "release_v[0-9.]\+") -gt 0 ]]; then | ||
| exit 0; | ||
| elif [[ $(expr match "${{ github.event.pull_request.head.ref }}" "dep-update-[a-zA-Z0-9]*") -gt 0 ]]; then | ||
| elif [[ $(expr match "${{ github.event.pull_request.head.ref }}" "latest-dep-update-[a-zA-Z0-9]*") -gt 0 ]]; then | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the release notes check to skip latest and minimum dependency branches
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call |
||
| exit 0; | ||
| elif [[ $(expr match "${{ github.event.pull_request.head.ref }}" "min-dep-update-[a-zA-Z0-9]*") -gt 0 ]]; then | ||
| exit 0; | ||
| fi | ||
| cat docs/source/release_notes.rst | grep ":pr:\`${{ github.event.number }}\`" | ||
Uh oh!
There was an error while loading. Please reload this page.