Skip to content

Commit

Permalink
Upgrade actions and code to python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalEgn committed Jul 24, 2024
1 parent 18fa6b0 commit e9bd3d1
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
name: Build and release
name: Bump package version and publish to pypi

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_call:

jobs:
Test:
runs-on: ubuntu-20.04
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.11"

- name: Install python dependencies
run: |
Expand All @@ -28,21 +25,15 @@ jobs:
- name: Show python dependencies
run: |
python3 --version
pip freeze
- name: Run tests
run: |
./run-tests.sh
- name: Build package
if: ${{ success() && github.event_name == 'push' }}
run: |
python setup.py sdist bdist_wheel
- name: Publish package
if: ${{ success() && github.event_name == 'push' }}
uses: pypa/[email protected]
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}

10 changes: 10 additions & 0 deletions .github/workflows/pull-request-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Pull request master

on:
pull_request:
branches:
- master

jobs:
python3_tests:
uses: ./.github/workflows/test-python-3.yml
16 changes: 16 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull request master

on:
push:
branches:
- master

jobs:
python3_tests:
uses: ./.github/workflows/test-python-3.yml

bump_version:
needs: [python3_tests]
uses: ./.github/workflows/publish.yml
secrets: inherit

42 changes: 42 additions & 0 deletions .github/workflows/test-python-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Python 3

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11"]
experimental: [false]
include:
- python-version: "3.x"
check-latest: true
experimental: true


steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests,opensearch2]
- name: Show python dependencies
run: |
python3 --version
pip freeze
- name: Run tests
run: |
./run-tests.sh
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
]

install_requires = [
'inspire-json-merger~=11.0,>=11.0.0',
'inspire-json-merger @ git+https://github.com/PascalEgn/inspire-json-merger.git@bump_py11',
'dictdiffer>=0.9.0',
'inspire-utils~=3.0,>=3.0.0',
'inspire-utils @ git+https://github.com/PascalEgn/inspire-utils.git@add-hepcrawl-parsers',
'invenio-search>=1.0.0a10',
'six~=1.0,>=1.11.0',
'invenio-base>=1.2.3,<2.0.0',
Expand Down

0 comments on commit e9bd3d1

Please sign in to comment.