From b8e8a345379a075789c758c0d54103b89c795df1 Mon Sep 17 00:00:00 2001 From: Jody Phelan Date: Mon, 29 Apr 2024 17:09:53 +0100 Subject: [PATCH] update testing --- .github/workflows/docs.yml | 54 ----------------------------------- .github/workflows/testing.yml | 42 +++++++++++++++++++++++++++ tests/run_test.py | 3 +- 3 files changed, 44 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 4b8f1f6..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["docs"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: build docs - uses: actions/setup-python@v4 - with: - python-version: 3.x - - uses: actions/cache@v2 - with: - key: ${{ github.ref }} - path: .cache - - run: pip install mkdocs-material - - run: mkdir docs/build - - run: mkdocs build -f docs/config/en/mkdocs.yml - - run: mkdocs build -f docs/config/pt/mkdocs.yml - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - # Upload entire repository - path: 'docs/build' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..3f301e2 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,42 @@ +# 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: + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + steps: + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 + with: + python-version: 3.8 + mamba-version: "*" + channels: conda-forge,bioconda,defaults + channel-priority: true + + - name: install dependancies + run: | + mamba create -n test tb-profiler -y + + - name: Install dependencies + run: | + conda activate test + pip install --force-reinstall . + - name: Run tests + run: | + cd tests + mamba install pytest -y + pytest -x . + diff --git a/tests/run_test.py b/tests/run_test.py index 67bccf7..4c341a3 100644 --- a/tests/run_test.py +++ b/tests/run_test.py @@ -31,9 +31,10 @@ ] db = 'testdb' +branch = 'who' def test_db(): - run_cmd(f"tb-profiler update_tbdb --branch test --prefix {db}") + run_cmd(f"tb-profiler update_tbdb --branch {branch} --prefix {db}") def check_assertations(filename):