Skip to content

Commit

Permalink
Testing I
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae committed Jun 30, 2024
1 parent 93bc60d commit 0ab3edf
Showing 1 changed file with 115 additions and 114 deletions.
229 changes: 115 additions & 114 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- main
- testing
release:
types:
- published
Expand Down Expand Up @@ -36,34 +37,34 @@ jobs:
matrix:
os: [ubuntu, ] # macos, windows] # Only Linux currently.
case:
- python-version: "3.9"
name: minimal
os: ubuntu
conda: "'scipy=1.9' 'numba=0.53' 'numpy<2.0' 'empymod>=2.3'"
- python-version: "3.10"
name: full
os: ubuntu
conda: "numba scipy xarray h5py discretize matplotlib 'numpy<2.0' 'empymod>=2.3'" # tqdm
- python-version: "3.10"
name: plain
os: ubuntu
conda: "numba scipy 'numpy<2.0' 'empymod>=2.3'"
- python-version: "3.11"
name: plain
os: ubuntu
conda: "numba scipy 'numpy<2.0' 'empymod>=2.3'"
# - python-version: "3.9"
# name: minimal
# os: ubuntu
# conda: "'scipy=1.9' 'numba=0.53' 'numpy<2.0' 'empymod>=2.3'"
# - python-version: "3.10"
# name: full
# os: ubuntu
# conda: "numba scipy xarray h5py discretize matplotlib 'numpy<2.0' 'empymod>=2.3'" # tqdm
# - python-version: "3.10"
# name: plain
# os: ubuntu
# conda: "numba scipy 'numpy<2.0' 'empymod>=2.3'"
# - python-version: "3.11"
# name: plain
# os: ubuntu
# conda: "numba scipy 'numpy<2.0' 'empymod>=2.3'"
- python-version: "3.11"
name: full
os: ubuntu
conda: "numba scipy xarray tqdm h5py discretize matplotlib pygimli 'numpy<2.0' 'empymod>=2.3'"
- python-version: "3.12"
name: plain
os: ubuntu
conda: "numba scipy 'numpy<2.0' 'empymod>=2.3'"
- python-version: "3.12"
name: full
os: ubuntu
conda: "numba scipy xarray tqdm h5py discretize matplotlib 'numpy<2.0' 'empymod>=2.3'"
# - python-version: "3.12"
# name: plain
# os: ubuntu
# conda: "numba scipy 'numpy<2.0' 'empymod>=2.3'"
# - python-version: "3.12"
# name: full
# os: ubuntu
# conda: "numba scipy xarray tqdm h5py discretize matplotlib 'numpy<2.0' 'empymod>=2.3'"

env:
# Used for coveralls flag
Expand Down Expand Up @@ -111,100 +112,100 @@ jobs:
shell: bash -l {0}
run: conda list

- name: Flake8
shell: bash -l {0}
run: flake8 docs/ setup.py emg3d/ tests/
# - name: Flake8
# shell: bash -l {0}
# run: flake8 docs/ setup.py emg3d/ tests/

- name: Test with pytest
shell: bash -l {0}
run: |
python -m pip install --no-build-isolation --no-deps .
pytest --cov=emg3d -svv
- name: Coveralls
# [pin @develop@20230609]
uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505
with:
parallel: true
flag-name: ${{ matrix.case.python-version }} ${{ matrix.case.name }} (${{ matrix.case.os }})


coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
# [pin @develop@20230609]
uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505
with:
parallel-finished: true

deploy:
needs: test
name: Deploy to PyPI
runs-on: ubuntu-latest
# Only from the origin repository, not forks; only main and tags.
if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
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
# the last release is greater than this, the version will still be
# wrong. Increase if necessary.
fetch-depth: 100
# The GitHub token is preserved by default but this job doesn't need
# to be able to push to GitHub.
persist-credentials: false

# Need the tags so that setuptools-scm can form a valid version number
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build setuptools-scm
- name: Build source and wheel distributions
if: github.ref == 'refs/heads/main'
run: |
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place 's/"root"/"local_scheme":"no-local-version","root"/g' setup.py
- name: Build source and wheel distributions
run: |
# Build source and wheel packages
python -m build
echo ""
echo "Generated files:"
ls -lh dist/
- name: Publish to Test PyPI
if: success()
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
# Allow existing releases on test PyPI without errors.
# NOT TO BE USED in PyPI!
skip-existing: true

- name: Publish to PyPI
# Only for releases
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
# - name: Coveralls
# # [pin @develop@20230609]
# uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505
# with:
# parallel: true
# flag-name: ${{ matrix.case.python-version }} ${{ matrix.case.name }} (${{ matrix.case.os }})
#
#
# coveralls_finish:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# # [pin @develop@20230609]
# uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505
# with:
# parallel-finished: true
#
# deploy:
# needs: test
# name: Deploy to PyPI
# runs-on: ubuntu-latest
# # Only from the origin repository, not forks; only main and tags.
# if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
#
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE
# - name: Checkout
# 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
# # the last release is greater than this, the version will still be
# # wrong. Increase if necessary.
# fetch-depth: 100
# # The GitHub token is preserved by default but this job doesn't need
# # to be able to push to GitHub.
# persist-credentials: false
#
# # Need the tags so that setuptools-scm can form a valid version number
# - name: Fetch git tags
# run: git fetch origin 'refs/tags/*:refs/tags/*'
#
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.9"
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install build setuptools-scm
#
# - name: Build source and wheel distributions
# if: github.ref == 'refs/heads/main'
# run: |
# # Change setuptools-scm local_scheme to "no-local-version" so the
# # local part of the version isn't included, making the version string
# # compatible with Test PyPI.
# sed --in-place 's/"root"/"local_scheme":"no-local-version","root"/g' setup.py
#
# - name: Build source and wheel distributions
# run: |
# # Build source and wheel packages
# python -m build
# echo ""
# echo "Generated files:"
# ls -lh dist/
#
# - name: Publish to Test PyPI
# if: success()
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_PASSWORD }}
# repository-url: https://test.pypi.org/legacy/
# # Allow existing releases on test PyPI without errors.
# # NOT TO BE USED in PyPI!
# skip-existing: true
#
# - name: Publish to PyPI
# # Only for releases
# if: success() && github.event_name == 'release'
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD }}

0 comments on commit 0ab3edf

Please sign in to comment.