Skip to content

Commit

Permalink
Add workflows (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC authored Dec 18, 2022
1 parent bb5d665 commit 4b8a4f7
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build

on:
release:
types: [published]

jobs:
deploy-wheel:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9']
os: [windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.AMULET_NBT_PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/* --skip-existing
30 changes: 30 additions & 0 deletions .github/workflows/python-stylecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Stylecheck

on:
push:
pull_request:

jobs:
stylecheck:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: run stylecheck
run: |
python -m black --check --diff src
python -m black --check --diff tests
30 changes: 30 additions & 0 deletions .github/workflows/python-unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Unittests

on:
push:
pull_request:

jobs:
unittests:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Test with unittest
run: python -m unittest discover -v -s tests

0 comments on commit 4b8a4f7

Please sign in to comment.