Skip to content

Commit

Permalink
Merge pull request #138 from poliastro/v1.0.0
Browse files Browse the repository at this point in the history
CI Fixes
  • Loading branch information
astrojuanlu authored Jun 25, 2024
2 parents b03f228 + 3eda138 commit a1357e3
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 54 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish to PyPi

on:
release:
types: [created]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: python3 -m pip install build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/czml3
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
60 changes: 6 additions & 54 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,13 @@
name: czml3 gh actions workflow
name: Run checks

on: [push, pull_request]
on: [pull_request]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/czml3
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

tox-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -75,19 +28,18 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Generate coverage report
run: python -m pytest --cov=./ --cov-report=xml:pytest_cov.xml
run: python -m pytest --cov=czml3 --cov-report=xml:pytest_cov.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./coverage/reports/
fail_ci_if_error: true
files: ./coverage.xml,./pytest_cov.xml,!./cache
flags: unittests
name: codecov-umbrella
files: pytest_cov.xml, coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

0 comments on commit a1357e3

Please sign in to comment.