diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9810571 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +# Check ThermoParser builds + +name: build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Build + run: | + python3 -m pip install . diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..586fa21 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +# Build ThermoParser's docs + +name: docs + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install sphinx sphinx_rtd_theme + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Build docs with sphinx + run: | + cd docs; sphinx-build -b html src/ . diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index 5917c66..0000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Python application - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install unitest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi -# - name: Lint with flake8 -# run: | -# # stop the build if there are Python syntax errors or undefined names -# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - python3 -m unittest -q diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e10b2a4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +# Run ThermoParser's tests + +name: tests + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install unitest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with unittest + run: | + python3 -m unittest diff --git a/README.rst b/README.rst index 743732f..25d903c 100644 --- a/README.rst +++ b/README.rst @@ -17,9 +17,17 @@ |____________________________________:_______________________/____________:_____/ -.. image:: https://travis-ci.com/smtg-bham/ThermoParser.svg?branch=master - :alt: The travis-ci badge - :target: https://travis-ci.com/smtg-bham/ThermoParser +.. image:: https://github.com/SMTG-Bham/ThermoParser/actions/workflows/build.yml/badge.svg + :alt: The build status badge + :target: https://github.com/SMTG-Bham/ThermoParser/actions/workflows/build.yml + +.. image:: https://github.com/SMTG-Bham/ThermoParser/actions/workflows/tests.yml/badge.svg + :alt: The tests status badge + :target: https://github.com/SMTG-Bham/ThermoParser/actions/workflows/tests.yml + +.. image:: https://github.com/SMTG-Bham/ThermoParser/actions/workflows/docs.yml/badge.svg + :alt: The docs status badge + :target: https://smtg-bham.github.io/ThermoParser/ ThermoParser is a toolkit used to simplify the analysis of data produced by specialist materials science codes, centred around