Skip to content

Commit

Permalink
Update workflows (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae authored Feb 26, 2024
1 parent 54daa78 commit 1fd015e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 43 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
schedule:
- cron: "14 14 20 * *"

# Cancel any previous run of the test job.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linkcheck:

Expand All @@ -20,26 +25,20 @@ jobs:

steps:

# Cancel any previous run of the test job; [pin v0.12.1 (2024-01-25)]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

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

- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
python -m pip install -r requirements-dev.txt
- name: Check links
shell: bash -l {0}
Expand Down
38 changes: 16 additions & 22 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ defaults:
# https://github.com/actions/setup-python/issues/132
shell: bash

# Cancel any previous run of the test job.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:

Expand Down Expand Up @@ -61,21 +66,15 @@ jobs:
conda: "numba scipy xarray tqdm empymod h5py scooby discretize matplotlib"

env:
# Used to for coveralls flag
# Used for coveralls flag
OS: ${{ matrix.case.os }}
PYTHON: ${{ matrix.case.python-version }}

steps:

# Cancel any previous run of the test job; [pin v0.12.1 (2024-01-25)]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
Expand All @@ -91,8 +90,7 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup miniconda
# [pin v3.0.1 (2023-11-29)]
uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.case.python-version }}
Expand Down Expand Up @@ -124,8 +122,7 @@ jobs:
pytest --cov=emg3d
- name: Coveralls
# [pin v20201129]
uses: AndreMiras/coveralls-python-action@f5fd5c309b39d01599fb92c72d4f7409ea78aec9
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: ${{ matrix.case.python-version }} ${{ matrix.case.name }} (${{ matrix.case.os }})
Expand All @@ -136,8 +133,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
# [pin v20201129]
uses: AndreMiras/coveralls-python-action@f5fd5c309b39d01599fb92c72d4f7409ea78aec9
uses: coverallsapp/github-action@v2
with:
parallel-finished: true

Expand All @@ -151,7 +147,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
Expand All @@ -167,7 +163,7 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

Expand All @@ -194,21 +190,19 @@ jobs:
- name: Publish to Test PyPI
if: success()
# Hash corresponds to v1.4.1
uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
# Allow existing releases on test PyPI without errors.
# NOT TO BE USED in PyPI!
skip_existing: true
skip-existing: true

- name: Publish to PyPI
# Only for releases
if: success() && github.event_name == 'release'
# Hash corresponds to v1.4.1
uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
16 changes: 7 additions & 9 deletions .github/workflows/macos_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ defaults:
# https://github.com/actions/setup-python/issues/132
shell: bash

# Cancel any previous run of the test job.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:

Expand All @@ -34,15 +39,9 @@ jobs:

steps:

# Cancel any previous run of the test job; [pin v0.12.1 (2024-01-25)]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
Expand All @@ -58,8 +57,7 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup miniconda
# [pin v3.0.1 (2023-11-29)]
uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python }}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ latest

- Fix remaining outdated ``python setup.py`` commands.

- Many small things to keep the package updated.


v1.8.2 : convert & pip-full
---------------------------
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ scooby
xarray
empymod
cython
discretize>=0.7.3
discretize
matplotlib

# SETUP RELATED
setuptools_scm

# FOR DOCUMENTATION
sphinx > 3
numpydoc >= 0.9
sphinx
numpydoc
sphinx_design
sphinx_numfig
pydata_sphinx_theme
Expand Down

0 comments on commit 1fd015e

Please sign in to comment.