Skip to content

Commit

Permalink
Updated github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Aug 3, 2023
1 parent 9660f0e commit a5db342
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 30 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: Install Poetry
uses: abatilo/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-python@v4

- name: Install dependencies
run: poetry install
run: pip install .[doc]

- name: Build docs
run: poetry run sphinx-build -b html docs docs/_build
run: sphinx-build -b html docs docs/_build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ name: Publish

on:
release:
types: created
types: [created]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4

- name: Install Poetry
uses: abatilo/[email protected]
- name: Install dependencies
run: pip install build

- name: Build
run: poetry build
run: python -m build

- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
26 changes: 12 additions & 14 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,32 @@ on: [push, pull_request]

jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-18.04
name: Build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
django-version: ['3.0', '3.1', '3.2', '4.0', '4.1', '4.2']

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: py-${{ matrix.python-version }}-django-${{ matrix.django-version }}-${{ hashFiles('**/poetry.lock') }}
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}-${{ hashFiles('pyproject.toml') }}

- name: Install Poetry
uses: abatilo/[email protected]
- name: Install Django
run: pip install django==${{ matrix.django-version }}

- name: Install dependencies
run: |
poetry add django==${{ matrix.django-version }}
poetry install
run: pip install -e .[test]

- name: Tests
run: poetry run scripts/test.sh
run: scripts/test.sh

- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

0 comments on commit a5db342

Please sign in to comment.