Skip to content

Commit

Permalink
modernize CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Mar 9, 2023
1 parent da9a57e commit 9e3ac0a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 91 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "Bot"
84 changes: 0 additions & 84 deletions .github/workflows/push.yml

This file was deleted.

18 changes: 11 additions & 7 deletions .github/workflows/publish.yml → .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
name: Publish to PyPI

on:
pull_request:
push:
branches:
- main
release:
types:
- published

jobs:

pypi-build:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: "3.x"

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
Expand All @@ -37,12 +40,13 @@ jobs:

- name: Test wheels
run: |
cd dist && python -m pip install pocean_core*.whl
cd dist && python -m pip install *.whl
python -m twine check *
shell: bash

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false

- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: >
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
&& micromamba activate TEST
&& python -m pip install -e . --no-deps --force-reinstall
- name: Tests
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m pytest --disable-warnings

0 comments on commit 9e3ac0a

Please sign in to comment.