Skip to content

Commit

Permalink
Update the github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
peekxc committed Aug 16, 2023
1 parent 67f7a27 commit 2574031
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 269 deletions.
168 changes: 0 additions & 168 deletions .github/CONTRIBUTING.md

This file was deleted.

18 changes: 0 additions & 18 deletions .github/pull_request_template.md

This file was deleted.

85 changes: 2 additions & 83 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.10"]
python: ["3.8", "3.9", "3.10"]
task:
- name: Test
run: |
pytest -v --color=yes tests/
include:
- python: "3.10"
task:
name: Lint
run: ruff check .

- python: "3.10"
task:
name: Type check
run: mypy .

- python: "3.10"
task:
name: Build
run: |
python -m build
- python: "3.10"
task:
name: Style
run: |
isort --check .
black --check .
- python: "3.10"
task:
name: Docs
run: cd docs && make html

steps:
- uses: actions/checkout@v3

Expand All @@ -71,16 +49,6 @@ jobs:
python-version: ${{ matrix.python }}
cache-prefix: ${{ env.CACHE_PREFIX }}

- name: Restore mypy cache
if: matrix.task.name == 'Type check'
uses: actions/cache@v3
with:
path: .mypy_cache
key: mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}-${{ github.ref }}
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}
- name: ${{ matrix.task.name }}
run: |
. .venv/bin/activate
Expand All @@ -97,53 +65,4 @@ jobs:
if: always()
run: |
. .venv/bin/activate
pip uninstall -y simplextree
release:
name: Release
runs-on: ubuntu-latest
needs: [checks]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install requirements
run: |
pip install --upgrade pip setuptools wheel build
pip install -e .[dev]
- name: Prepare environment
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Download package distribution files
uses: actions/download-artifact@v3
with:
name: package
path: dist

- name: Generate release notes
run: |
python scripts/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
- name: Publish package to PyPI
run: |
twine upload -u '${{ secrets.PYPI_USERNAME }}' -p '${{ secrets.PYPI_PASSWORD }}' dist/*
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}-RELEASE_NOTES.md
prerelease: ${{ contains(env.TAG, 'rc') }}
files: |
dist/*
pip uninstall -y simplextree
File renamed without changes.

0 comments on commit 2574031

Please sign in to comment.