Skip to content

Commit

Permalink
new gh wf
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornFJohansson committed Dec 8, 2023
2 parents 27b97b3 + 8c8746d commit 780c720
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pydna_pypi_build_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build for PyPI from master branch
on:
release:
types: [published]
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"
72 changes: 72 additions & 0 deletions .github/workflows/pydna_test_and_coverage_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Tests & Coverage
on:
push:
branches:
- '**'
- '!master' # excludes master branch
- '!testpypi' # excludes testpypi branch
tags-ignore:
- '*.*'
pull_request: {}
jobs:
build:
name: Test (${{ matrix.python-version }}, ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ 'macos-latest', 'windows-latest' ]
python-version: ["3.12", "3.11", "3.10", "3.9", "3.8"]
include:
- os: ubuntu-latest
python-version: "3.8"
codecov: true
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout
uses: actions/checkout@v3

- name: 🔩 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: 🐍 Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs.prefer-active-python: true

- name: 🔩 list Poetry settings
run: poetry config --list

- name: 🔩 Install with Poetry
run: poetry install --all-extras --with test

- name: 🔎 poetry run python run_test.py
run: poetry run python run_test.py

- name: 🔼 Upload coverage to Codecov
if: (matrix.codecov)
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
18 changes: 18 additions & 0 deletions .github/workflows/pydna_test_pypi_build_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build for TESTPyPI from testpypi branch
on:
release:
types: [published]
branches:
- testpypi
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"
plugins: "poetry-dynamic-versioning[plugin]"

0 comments on commit 780c720

Please sign in to comment.