Skip to content

Commit

Permalink
ci: Update constraints and sync template for dependabot. (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Sep 14, 2023
1 parent 65b5b30 commit fe4550e
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -53,6 +53,45 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
dependabot:
if: ${{ github.actor == 'dependabot[bot]' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Set up Git
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Set up Python with multiple versions.
uses: actions/setup-python@v4
with:
cache: pip
python-version: |
3.8
3.9
3.10
3.11
- name: Install pipenv using pipx
run: pipx install pipenv
- name: Generate constraints for all supported Python versions
run: |
CI= PYTHON_VERSION=3.8 make constraints
CI= PYTHON_VERSION=3.9 make constraints
CI= PYTHON_VERSION=3.10 make constraints
CI= PYTHON_VERSION=3.11 make constraints
- name: Sync template
run: cp -v constraints/* template/constraints/
- name: Push changes if applicable
run: |
if [[ -n `git status --porcelain` ]]; then
git commit -a -m "Update constraints and sync template."
git push
fi
name: CI
on:
pull_request:
Expand Down
Expand Up @@ -72,6 +72,61 @@ jobs:
- '3.11'
[%- endif %]
[%- endif %]
dependabot:
if: {{ '${{ github.actor == \'dependabot[bot]\' }}' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: {{ '${{ github.head_ref }}' }}
- name: Set up Git
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Set up Python with multiple versions.
uses: actions/setup-python@v4
with:
cache: pip
python-version: |
[%- if version_between("3.8", min_py, max_py) %]
3.8
[%- endif %]
[%- if version_between("3.9", min_py, max_py) %]
3.9
[%- endif %]
[%- if version_between("3.10", min_py, max_py) %]
3.10
[%- endif %]
[%- if version_between("3.11", min_py, max_py) %]
3.11
[%- endif %]
- name: Install pipenv using pipx
run: pipx install pipenv
- name: Generate constraints for all supported Python versions
run: |
[%- if version_between("3.8", min_py, max_py) %]
CI= PYTHON_VERSION=3.8 make constraints
[%- endif %]
[%- if version_between("3.9", min_py, max_py) %]
CI= PYTHON_VERSION=3.9 make constraints
[%- endif %]
[%- if version_between("3.10", min_py, max_py) %]
CI= PYTHON_VERSION=3.10 make constraints
[%- endif %]
[%- if version_between("3.11", min_py, max_py) %]
CI= PYTHON_VERSION=3.11 make constraints
[%- endif %]
- name: Sync template
run: cp -v constraints/* template/constraints/
- name: Push changes if applicable
run: |
if [[ -n `git status --porcelain` ]]; then
git commit -a -m "Update constraints and sync template."
git push
fi
name: CI
on:
pull_request:
Expand Down

0 comments on commit fe4550e

Please sign in to comment.