|
| 1 | +name: Minimum dependency checker |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + paths: |
| 7 | + - 'pyproject.toml' |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout repository |
| 13 | + uses: actions/checkout@v3 |
| 14 | + with: |
| 15 | + ref: ${{ github.event.pull_request.head.ref }} |
| 16 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 17 | + - name: Run min dep generator - test requirements |
| 18 | + id: min_dep_gen_test |
| 19 | + |
| 20 | + with: |
| 21 | + paths: 'pyproject.toml' |
| 22 | + options: 'dependencies' |
| 23 | + extras_require: 'test' |
| 24 | + - name: Save min test requirements and run diff |
| 25 | + id: check_min_test |
| 26 | + continue-on-error: true |
| 27 | + run: | |
| 28 | + mkdir /tmp/dependencies_updated_artifacts |
| 29 | + printf "${{ steps.min_dep_gen_test.outputs.min_reqs }}" > /tmp/minimum_test_requirements.txt |
| 30 | + diff /tmp/minimum_test_requirements.txt tests/dependency_update_check/minimum_test_requirements.txt |
| 31 | + - name: if min test requirements have changed, write output file |
| 32 | + if: steps.check_min_test.outcome != 'success' |
| 33 | + run: | |
| 34 | + printf "${{ steps.min_dep_gen_test.outputs.min_reqs }}" > tests/dependency_update_check/minimum_test_requirements.txt |
| 35 | + - name: Run min dep generator - requirements |
| 36 | + id: min_dep_gen_reqs |
| 37 | + |
| 38 | + with: |
| 39 | + paths: 'pyproject.toml' |
| 40 | + options: 'dependencies' |
| 41 | + - name: Save min requirements and run diff |
| 42 | + id: check_min_reqs |
| 43 | + continue-on-error: true |
| 44 | + run: | |
| 45 | + printf "${{ steps.min_dep_gen_reqs.outputs.min_reqs }}" > /tmp/minimum_requirements.txt |
| 46 | + diff /tmp/minimum_requirements.txt tests/dependency_update_check/minimum_requirements.txt |
| 47 | + - name: if min requirements have changed, write output file |
| 48 | + if: steps.check_min_reqs.outcome != 'success' |
| 49 | + run: | |
| 50 | + printf "${{ steps.min_dep_gen_reqs.outputs.min_reqs }}" > tests/dependency_update_check/minimum_requirements.txt |
| 51 | + - name: Create Pull Request |
| 52 | + uses: peter-evans/create-pull-request@v3 |
| 53 | + with: |
| 54 | + token: ${{ secrets.MACHINEFL_DEPENDENCY_CHECKER_TOKEN }} |
| 55 | + commit-message: Update minimum dependencies |
| 56 | + title: Automated Minimum Dependency Updates |
| 57 | + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
| 58 | + body: "This is an auto-generated PR with **minimum** dependency updates. |
| 59 | + Please do not delete the `min-dep-update` branch because it's needed by the auto-dependency bot." |
| 60 | + branch: min-dep-update |
| 61 | + branch-suffix: short-commit-hash |
| 62 | + base: main |
| 63 | + assignees: machineFL |
| 64 | + reviewers: machineAYX, jeremyliweishih, bchen1116, chukarsten, ParthivNaresh, eccabay, christopherbunn, fjlanasa, MichaelFu512, tamargrey |
0 commit comments