Skip to content

Commit

Permalink
Merge pull request #16 from yutanagano/add_gh_workflows
Browse files Browse the repository at this point in the history
Add github workflows
  • Loading branch information
yutanagano authored Jun 4, 2024
2 parents 115c66a + 9c1d9c6 commit b85123e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish_to_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish to PyPI
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: check out branch
uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: install build
run: python3 -m pip install build --user
- name: build wheel and source tarball
run: python3 -m build
- name: store distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish:
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sceptr
permissions:
id-token: write
steps:
- name: download dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: publish
uses: pypa/gh-action-pypi-publish@release/v1
23 changes: 23 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: tests
on: pull_request
jobs:
run_tox:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_ver: ['3.12']

runs-on: ${{ matrix.os }}
steps:
- name: Check out branch
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_ver }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run tox
run: tox
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tox]
env_list =
lint, py{39, 310, 311}
lint, py{39, 310, 311, 312}

[gh-actions]
python =
3.11: py311
3.12: py312

[testenv]
description = run unit tests
Expand All @@ -18,4 +18,4 @@ description = run linters
skip_install = true
deps =
black>=23
commands = black .
commands = black .

0 comments on commit b85123e

Please sign in to comment.