Skip to content

Fixed unzip on windows test #538

Fixed unzip on windows test

Fixed unzip on windows test #538

Workflow file for this run

name: windows-utils-test
on:
push:
paths-ignore: [".ci_helpers/docker/**", "**/docker.yaml"]
pull_request:
paths-ignore: [".ci_helpers/docker/**", "**/docker.yaml"]
pull_request_target:
paths-ignore: [".ci_helpers/docker/**", "**/docker.yaml"]
workflow_dispatch:
env:
CONDA_ENV: echopype
TEST_DATA_FOLDER: ${{ github.workspace }}\\echopype\\test_data
jobs:
windows-test:
name: windows-${{ matrix.python-version }}-build
runs-on: "windows-latest"
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.9
experimental: false
defaults:
run:
shell: powershell
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Setup miniconda w/mamba
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: ${{ env.CONDA_ENV }}
environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml
# Currently problematic! See https://github.com/mamba-org/mamba/issues/2157
# - name: Setup micromamba
# uses: mamba-org/provision-with-micromamba@v15
# with:
# environment-file: .ci_helpers/py${{ matrix.python-version }}.yaml
# environment-name: ${{ env.CONDA_ENV }}
# cache-env: true
# cache-env-key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(format('.ci_helpers/py{0}.yaml', matrix.python-version)) }}
- name: Print conda info
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Install dev tools
run: |
mamba install -c conda-forge -n ${{ env.CONDA_ENV }} --yes --file requirements-dev.txt
- name: Install echopype
run: |
python -m pip install -e .
# Add steps for downloading and unzipping test data
- name: Create Test Data Directory
run: New-Item -ItemType Directory -Force -Path ${{ env.TEST_DATA_FOLDER }}
- name: Download Test Data from Google Drive
run: |
$response = Invoke-WebRequest -Uri "https://drive.google.com/uc?export=download&id=1ofiSQ4zDwXfHE65tow4_jDIceBYHNW_8" -OutFile "test_data.zip" -PassThru
if ($response.StatusCode -ne 200) {
Write-Error "File download failed with status code $($response.StatusCode)"
exit 1
}
- name: Unzip Test Data
run: |
try {
Expand-Archive -LiteralPath "test_data.zip" -DestinationPath ${{ env.TEST_DATA_FOLDER }} -Force
}
catch {
Write-Error "Failed to unzip file: $_"
exit 1
}
- name: Running all Tests
run: |
pytest -vvv -rx --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings echopype/tests/utils |& tee ci_${{ matrix.python-version }}_test_log.log