Skip to content

Commit

Permalink
ci: Update CI to barebone python [all tests ci] (#1192)
Browse files Browse the repository at this point in the history
* ci: Add installed packages listing

* ci: Add pip listing

* ci: Remove conda from PR action

* ci: Update worklows and add P2Z skip

* ci: More cleanup to workflow

* ci: Bump actions/setup-python from 4.7.0 to 4.7.1
  • Loading branch information
lsetiawan authored Oct 9, 2023
1 parent 7d413ec commit 0bc534e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 53 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,20 @@ on:
workflow_dispatch:

env:
CONDA_ENV: echopype
NUM_WORKERS: 2

jobs:
test:
name: ${{ matrix.python-version }}-build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"] # TODO: add back 3.11 once parsed2zarr is fixed
python-version: ["3.9", "3.10", "3.11"]
runs-on: [ubuntu-latest]
experimental: [false]
include:
- runs-on: ubuntu-latest
python-version: "3.11"
experimental: true
services:
# TODO: figure out how to update tag when there's a new one
minio:
Expand All @@ -46,30 +41,20 @@ jobs:
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml
environment-name: ${{ env.CONDA_ENV }}
cache-environment: true
post-cleanup: 'all'
- name: Print conda environment
shell: bash -l {0}
run: |
micromamba info
micromamba list
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Remove docker-compose python
if: ${{ matrix.python-version == '3.10' || matrix.python-version == '3.11' }}
shell: bash -l {0}
run: sed -i "/docker-compose/d" requirements-dev.txt
- name: Install dev tools
shell: bash -l {0}
run: |
micromamba install -c conda-forge -n ${{ env.CONDA_ENV }} --yes --file requirements-dev.txt
run: python -m pip install -r requirements-dev.txt
- name: Install echopype
shell: bash -l {0}
run: |
python -m pip install -e .[plot]
run: python -m pip install -e ".[plot]"
- name: Print installed packages
run: python -m pip list
- name: Copying test data to services
shell: bash -l {0}
run: |
Expand Down
39 changes: 12 additions & 27 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
paths-ignore: ["**/docker.yaml", "docs"]

env:
CONDA_ENV: echopype
NUM_WORKERS: 2

jobs:
Expand All @@ -17,16 +16,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"] # TODO: add back 3.11 once parsed2zarr is fixed
python-version: ["3.9", "3.10", "3.11"]
runs-on: [ubuntu-latest]
experimental: [false]
include:
- runs-on: ubuntu-latest
python-version: "3.11"
experimental: true
defaults:
run:
shell: bash -l {0}
services:
# TODO: figure out how to update tag when there's a new one
minio:
Expand All @@ -42,35 +34,28 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml
environment-name: ${{ env.CONDA_ENV }}
cache-environment: true
post-cleanup: 'all'
- name: Print conda environment
run: |
micromamba info
micromamba list
- name: Remove docker-compose python
if: ${{ matrix.python-version == '3.10' || matrix.python-version == '3.11' }}
run: sed -i "/docker-compose/d" requirements-dev.txt
- name: Install dev tools
run: |
micromamba install -c conda-forge -n ${{ env.CONDA_ENV }} --yes --file requirements-dev.txt
run: python -m pip install -r requirements-dev.txt
# We only want to install this on one run, because otherwise we'll have
# duplicate annotations.
- name: Install error reporter
if: ${{ matrix.python-version == '3.9' }}
run: |
python -m pip install pytest-github-actions-annotate-failures
run: python -m pip install pytest-github-actions-annotate-failures
- name: Install echopype
run: |
python -m pip install -e .[plot]
run: python -m pip install -e ".[plot]"
- name: Print installed packages
run: python -m pip list
- name: Copying test data to services
run: |
python .ci_helpers/docker/setup-services.py --deploy --data-only --http-server ${{ job.services.httpserver.id }}
Expand Down
2 changes: 2 additions & 0 deletions echopype/tests/convert/test_parsed_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from echopype.echodata.convention import sonarnetcdf_1
from echopype.convert.api import _check_file, SONAR_MODELS

pytestmark = pytest.mark.skip(reason="Removed Parsed2Zarr")

test_bucket_name = "echopype-test"
port = 5555
endpoint_uri = "http://127.0.0.1:%s/" % port
Expand Down

0 comments on commit 0bc534e

Please sign in to comment.