Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build

on:
release:
types:
- released
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@86823142467dd2afcd1bbac57d3a664cf468eb3b # v2.1.0
with:
upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }}
secrets:
pypi_token: ${{ secrets.PYPI_TOKEN }}
49 changes: 31 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
name: test

on: [pull_request]
on:
pull_request:
release:
types:
- created

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

test:

name: Python ${{ matrix.python-version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
runs-on:
- ubuntu-latest
- macos-latest
python-version:
- '3.10'
- '3.11'
- '3.12'
fail-fast: false

runs-on: ${{ matrix.runs-on }}
name: Python ${{ matrix.python-version }} (${{ matrix.runs-on }})
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml

- name: set useful environment variables
run: |
echo PYTHONVERSION=${{ matrix.python-version }} >> $GITHUB_ENV
echo EXOCTK_DATA=$RUNNER_WORKSPACE/exoctk/exoctk/data/ >> $GITHUB_ENV

- run: pip freeze

- run: pip install .
- run: pip freeze > requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
- run: pip install .[test]

- run: pytest exoctk/tests/
- run: pytest exoctk/tests/ --cov ./ --cov-report term-missing --cov xml -n auto
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
files: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
path: requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
- if: (github.event_name == 'release' && github.event.action == 'published')
uses: svenstaro/upload-release-action@v2
with:
file: requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exoctk/__pycache__
# Other generated files
*/_version.py
*/cython_version.py
*/_version.py
htmlcov
.coverage
MANIFEST
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dynamic = ["version"]
test = [
"pytest",
"pytest-cov",
"pytest-xdist",
]
docs = [
"sphinx",
Expand Down
Loading