forked from OSOceanAcoustics/echopype
-
Notifications
You must be signed in to change notification settings - Fork 4
96 lines (91 loc) · 4.29 KB
/
windows-utils.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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 }}\\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: Install wget
run: choco install wget
shell: powershell
#- name: Download Test Data from Google Drive
# run: |
# $downloadLink = "https://drive.google.com/uc?export=download&id=1ofiSQ4zDwXfHE65tow4_jDIceBYHNW_8"
# $downloadPage = Invoke-WebRequest -Uri $downloadLink -OutFile "download.html"
# $confirmCode = (Select-String -Path "download.html" -Pattern 'confirm=([0-9A-Za-z_]+)' -AllMatches).Matches.Groups[1].Value
# $downloadFileLink = "https://drive.google.com/uc?export=download&confirm=$confirmCode&id=1ofiSQ4zDwXfHE65tow4_jDIceBYHNW_8"
# Invoke-WebRequest -Uri $downloadFileLink -OutFile "test_data.zip"
- name: Download Test Data from Google Drive
run: |
Remove-Item alias:wget
wget --quiet --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://drive.google.com/uc?export=download&id=1ofiSQ4zDwXfHE65tow4_jDIceBYHNW_8' -O- | Out-String | Select-String -Pattern 'confirm=([0-9A-Za-z_]+)' | %{ $_.Matches.Groups[1].Value } > confirm.txt
$confirmCode = Get-Content confirm.txt
wget --load-cookies cookies.txt "https://drive.google.com/uc?export=download&confirm=$confirmCode&id=1ofiSQ4zDwXfHE65tow4_jDIceBYHNW_8" -O test_data.zip
Remove-Item cookies.txt -Force
Remove-Item confirm.txt -Force
shell: powershell
- name: Unzip Test Data
run: Expand-Archive -LiteralPath "test_data.zip" -DestinationPath ${{ env.TEST_DATA_FOLDER }} -Force
- 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