Skip to content

Commit

Permalink
try using WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Feb 6, 2024
1 parent 2fce6f0 commit 6e1e9e6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 21 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,16 @@ on:
concurrency:
group: build-${{ github.ref }}

defaults:
run:
shell: micromamba-shell {0}

jobs:
date:
runs-on: ubuntu-latest
steps:
- run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
id: date
shell: bash
outputs:
date: ${{ steps.date.outputs.date }}
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -53,16 +46,23 @@ jobs:
id: version
with:
args: --pattern "(?P<base>\d+\.\d+\.\d+)"
outputs:
version: ${{ steps.version.outputs.version }}
build:
needs: [ date, version ]
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
runs-on: ${{ matrix.runs-on }}
name: build (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo {0}' || 'wsl-bash {0}' }}
steps:
- if: matrix.runs-on == 'windows-latest'
uses: Vampire/setup-wsl@v2
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -75,8 +75,9 @@ jobs:
cache-downloads-key: downloads-${{ needs.date.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
init-shell: none
generate-run-shell: true
init-shell: >-
${{ matrix.runs-on != 'windows' && 'bash' || 'wsl-bash' }}
generate-run-shell: false
- run: conda env export --no-build | grep -v "name:" | grep -v "prefix:"
- run: pytest -n auto tests/test_import.py
- run: echo "filename=stenv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ needs.version.outputs.version }}.yaml" >> $GITHUB_OUTPUT
Expand Down
43 changes: 32 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: micromamba-shell {0}

env:
CRDS_PATH: /tmp/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
Expand All @@ -27,7 +23,7 @@ jobs:
strategy:
matrix:
package: [ acstools, asdf, calcos, ccdproc, costools, synphot, jwst ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
- package: acstools
Expand Down Expand Up @@ -68,7 +64,12 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: ${{ matrix.package }} (Python ${{ matrix.python-version }}, tox ${{ matrix.default_factors }}${{ matrix.args != '' && ' -- ' || '' }}${{ matrix.args }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo {0}' || 'wsl-bash {0}' }}
steps:
- if: matrix.runs-on == 'windows-latest'
uses: Vampire/setup-wsl@v2
- uses: actions/checkout@v4
with:
path: stenv
Expand Down Expand Up @@ -119,10 +120,9 @@ jobs:
unit_tests_via_package:
needs: [ build ]
strategy:
fail-fast: false
matrix:
package: [ reftools, wfpc2tools ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
#- package: pysynphot
Expand All @@ -139,9 +139,15 @@ jobs:
python-version: '3.9'
- runs-on: macos-14
python-version: '3.10'
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: ${{ matrix.package }} (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo {0}' || 'wsl-bash {0}' }}
steps:
- if: matrix.runs-on == 'windows'
uses: Vampire/setup-wsl@v2
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
Expand Down Expand Up @@ -177,7 +183,7 @@ jobs:
strategy:
matrix:
package: [ hstcal ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
#- package: drizzlepac
Expand Down Expand Up @@ -206,7 +212,12 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: ${{ matrix.package }} (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo {0}' || 'wsl-bash {0}' }}
steps:
- if: matrix.runs-on == 'windows-latest'
uses: Vampire/setup-wsl@v2
- uses: actions/checkout@v4
with:
path: stenv
Expand Down Expand Up @@ -262,10 +273,9 @@ jobs:
CRDS_TEST_ROOT: /tmp
CRDS_TESTING_CACHE: /tmp/crds-cache-test
strategy:
fail-fast: false
matrix:
package: [ crds ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
- package: crds
Expand All @@ -279,9 +289,15 @@ jobs:
python-version: '3.9'
- runs-on: macos-14
python-version: '3.10'
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: ${{ matrix.package }} (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo {0}' || 'wsl-bash {0}' }}
steps:
- if: matrix.runs-on == 'windows-latest'
uses: Vampire/setup-wsl@v2
- uses: actions/checkout@v4
with:
path: stenv
Expand Down Expand Up @@ -327,7 +343,7 @@ jobs:
strategy:
matrix:
package: [ calcos, drizzlepac ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
- package: calcos
Expand All @@ -352,7 +368,12 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: ${{ matrix.package }} (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo {0}' || 'wsl-bash {0}' }}
steps:
- if: matrix.runs-on == 'windows-latest'
uses: Vampire/setup-wsl@v2
- uses: actions/checkout@v4
with:
lfs: true
Expand Down

0 comments on commit 6e1e9e6

Please sign in to comment.