diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..3377b80 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,47 @@ +name: pages + +on: + push: + branches: + - development + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + + - name: Install package and docs dependencies + run: pip install . sphinx numpydoc sphinx-book-theme + + - name: Build docs + run: sphinx-build -b html docs/source public + + - uses: actions/configure-pages@v6 + + - uses: actions/upload-pages-artifact@v5 + with: + path: public + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml new file mode 100644 index 0000000..b87c146 --- /dev/null +++ b/.github/workflows/test_code.yml @@ -0,0 +1,27 @@ +name: test_code + +on: + pull_request: + push: + branches: + - development + +jobs: + test_code: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python-version }} + + - name: Install package + run: pip install . + + - name: Run tests + run: python3 -m unittest discover -s tomotok/tests -t . -p "test_*.py" diff --git a/.github/workflows/test_pages.yml b/.github/workflows/test_pages.yml new file mode 100644 index 0000000..6dfb33d --- /dev/null +++ b/.github/workflows/test_pages.yml @@ -0,0 +1,20 @@ +name: test_pages + +on: + pull_request: + +jobs: + test_pages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + + - name: Install package and docs dependencies + run: pip install . sphinx numpydoc sphinx-book-theme + + - name: Build docs + run: sphinx-build -b html docs/source public diff --git a/.gitignore b/.gitignore index 7a5d7e1..b659cea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,12 @@ -.*/ -__pycache__/ -docs/build - # package build build/ dist/ target/ *.egg-info/ + +# docs build +docs/build + +# caches +__pycache__/ +./.pytest_cache/