diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..218ff4c --- /dev/null +++ b/.github/workflows/black.yaml @@ -0,0 +1,22 @@ +name: Lint with Black + +on: + push: + paths: + - src/** + - tests/** + branches: + - main + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: psf/black@stable + with: + options: "--check --verbose --exclude docs" + + diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..157c074 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,41 @@ +# This is a basic workflow to help you get started with Actions + +name: Tests + +# Controls when the workflow will run +on: + push: + paths: + - src/** + - tests/** + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + + - name: Run with tox + run: tox diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 0000000..09e8e70 --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,45 @@ +name: Coverage + +on: + push: + paths: + - src/** + - tests/** + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + + - name: Run coverage + run: tox -e coverage + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..98f5893 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,33 @@ +name: Publish to PyPI + +on: + release: + types: [ published ] + branches: [ main ] + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install poetry and dependencies + run: | + python -m pip install --upgrade pip + python -m pip install poetry + + - name: Configure poetry + env: + pypi_token: ${{ secrets.PyPI_TOKEN }} + run: poetry config pypi-token.pypi $pypi_token + + - name: Build and publish + run: poetry publish --build diff --git a/pyproject.toml b/pyproject.toml index bdc1b39..b5aa71f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "compmec-section" -version = "0.0.1" +version = "0.2.0" description = "Analysis of beams cross-section using the boundary element method" authors = ["Carlos Adir "] readme = "README.md" diff --git a/src/compmec/section/__init__.py b/src/compmec/section/__init__.py index 60cdff4..5d5f8dc 100644 --- a/src/compmec/section/__init__.py +++ b/src/compmec/section/__init__.py @@ -3,7 +3,7 @@ It uses mainly curves as boundary to compute the elements. """ -__version__ = "0.0.1" +__version__ = "0.2.0" if __name__ == "__main__": pass diff --git a/tox.ini b/tox.ini index 34c04a5..95a79ae 100644 --- a/tox.ini +++ b/tox.ini @@ -5,11 +5,14 @@ envlist = python3.8, python3.9, python3.10, + python3.11, + python3.12, coverage, [testenv] deps = numpy + compmec-shape pytest pytest-order pytest-timeout @@ -21,12 +24,15 @@ commands = python = 3.7: py37 3.8: py38 - 3.9: py39, coverage - 3.10: py310 + 3.9: py39 + 3.10: py310, coverage + 3.11: py311 + 3.12: py312 [testenv:coverage] deps = numpy + compmec-shape pytest pytest-cov pytest-order @@ -36,7 +42,7 @@ deps = commands = coverage erase pytest --cov={envsitepackagesdir}/compmec/section --cov-report=xml tests - coverage report -m --fail-under 20 + coverage report -m --fail-under 80 coverage xml [testenv:format]