From aba50dddb99d5e88aaaeffd8a0a944807b4c89c8 Mon Sep 17 00:00:00 2001 From: jhcepas Date: Tue, 19 Sep 2023 16:50:59 +0200 Subject: [PATCH] added first version of github actions to handle tests and documentation --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++ .github/workflows/update_docs.yml | 39 +++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/update_docs.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..069423423 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test Pipeline + +on: + push: + branches: + - '*' + - '!gh-pages' # excludes master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checkout the latest code + - name: Checkout Code + uses: actions/checkout@v2 + + # Setup Python environment + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + # Install dependencies for your project + - name: Install Dependencies + run: | + pip install .[test] + pip install sphinx + + # Run tests + - name: Run Tests + run: | + cd tests + pytest \ + test_arraytable.py test_clustertree.py test_gtdbquery.py \ + test_interop.py test_phylotree.py test_seqgroup.py test_tree.py \ + test_treediff.py test_orthologs_group_delineation.py test_ncbiquery.py \ + test_nexus.py test_treematcher.py \ + test_treeview/test_all_treeview.py + + # Build Sphinx documentation + - name: Generate Sphinx Documentation + run: | + cd doc + make html diff --git a/.github/workflows/update_docs.yml b/.github/workflows/update_docs.yml new file mode 100644 index 000000000..b9d70d48c --- /dev/null +++ b/.github/workflows/update_docs.yml @@ -0,0 +1,39 @@ +name: Update github pages docs + +on: + push: + branches: + - online_docs + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checkout the latest code + - name: Checkout Code + uses: actions/checkout@v2 + + # Setup Python environment + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + # Install dependencies for your project + - name: Install Dependencies + run: | + pip install . + pip install sphinx + + # Build Sphinx documentation + - name: Generate Sphinx Documentation + run: | + cd doc + make html + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/_build