From f606e05c81d4a0f257fa6db4edc93c3681ae2ec9 Mon Sep 17 00:00:00 2001 From: glados Date: Mon, 13 Jan 2025 14:24:11 +0100 Subject: [PATCH] Update --- .github/workflows/install-pkg.yml | 4 ++-- .github/workflows/quality.yml | 17 +++++++++++++ .github/workflows/test.yml | 40 +++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/quality.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/install-pkg.yml b/.github/workflows/install-pkg.yml index 088d922..85170aa 100644 --- a/.github/workflows/install-pkg.yml +++ b/.github/workflows/install-pkg.yml @@ -54,11 +54,11 @@ jobs: - name: Test wheel installation run: | pip install dist/*.whl - python -c "import ipybox" + python -c "import ipyboxasdf" pip uninstall -y ipybox - name: Test tarball installation run: | pip install dist/*.tar.gz - python -c "import ipybox" + python -c "import ipyboxasdf" pip uninstall -y ipybox diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..216a5d8 --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,17 @@ +name: Quality Checks + +on: workflow_dispatch # [push, pull_request] + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a1b7666 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Run Tests + +on: workflow_dispatch #[push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache conda + uses: actions/cache@v4 + env: + CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed + with: + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} + + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + environment-file: environment.yml + + - name: Install Poetry + uses: abatilo/actions-poetry@v3 + with: + poetry-version: 1.8.5 + + - name: Install dependencies + shell: bash -l {0} + run: | + poetry env info + poetry install + pip list + + - name: Run tests + shell: bash -l {0} + run: | + poetry run pytest -s