Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: various updates #75

Merged
merged 1 commit into from
Oct 23, 2023
Merged
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
28 changes: 20 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:

default-shell:
standard:

strategy:
fail-fast: false
Expand All @@ -17,25 +17,37 @@ jobs:

defaults:
run:
shell: bash -l {0}
shell: bash -e -l {0}

name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }}
name: ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}

steps:

- name: Basic GitHub action setup
- name: Clone this library
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set conda environment
uses: mamba-org/provision-with-micromamba@main
- name: Create conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-file: environment.yaml
environment-name: myenv
cache-env: true
init-shell: bash
cache-downloads: true

- name: Export version of this library
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV

- name: Install library
run: python -m pip install .
run: python -m pip install . -v --no-build-isolation --no-deps

- name: Run tests
run: python -m unittest discover tests -v

- name: Build docs
working-directory: docs
run: make html
5 changes: 3 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: pre-commit

on:
workflow_dispatch:
pull_request:
push:
branches: [main]
Expand All @@ -10,5 +11,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- uses: actions/setup-python@v4
- uses: pre-commit/action@main
46 changes: 31 additions & 15 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
name: Upload Python Package

on:
workflow_dispatch:
release:
types: [created]

jobs:
deploy:

pypi-publish:

name: Upload release to PyPI

runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/enstat

permissions:
id-token: write

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout
uses: actions/checkout@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
fetch-depth: 0

- name: Set latest release tag
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $LATEST_TAG
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV

- name: Install deps
run: python -m pip install -U setuptools build wheel

- name: Build
run: python -m build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading