Skip to content

Commit

Permalink
build for WSL in separate job
Browse files Browse the repository at this point in the history
build for WSL in separate job
  • Loading branch information
zacharyburnett committed Feb 6, 2024
1 parent dfc17ef commit e3dfa11
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 40 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,16 @@ jobs:
build:
needs: [ date, version ]
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: build (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
defaults:
run:
shell: ${{ matrix.runs-on != 'windows-latest' && 'bash -leo pipefail {0}' || 'wsl-bash {0}' }}
shell: bash -leo pipefail {0}
steps:
- if: matrix.runs-on == 'windows-latest'
id: wsl
uses: Vampire/setup-wsl@v2
- if: matrix.runs-on == 'windows-latest'
run: echo ${{ steps.wsl.outputs.wsl-shell-distribution-wrapper-path }}
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -78,8 +73,7 @@ jobs:
cache-downloads-key: downloads-${{ needs.date.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
init-shell: >-
${{ matrix.runs-on != 'windows' && 'bash' || 'wsl-bash' }}
init-shell: 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
Expand All @@ -95,3 +89,22 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
file: ${{ steps.output.outputs.filename }}
build_wsl:
needs: [ date, version ]
runs-on: windows-latest
name: build (WSL)
defaults:
run:
shell: wsl-bash {0}
steps:
- uses: Vampire/setup-wsl@v2
with:
additional-packages: curl
- name: install micromamba
run: |
mkdir -p ~/micromamba-bin/
curl -o ~/micromamba-bin/micromamba https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-linux-64
~/micromamba-bin/micromamba shell --init
- run: micromamba env create --name stenv-wsl --file https://raw.githubusercontent.com/spacetelescope/stenv/main/environment.yaml


39 changes: 9 additions & 30 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ env:
PYSYN_CDBS: /tmp/trds
LD_LIBRARY_PATH: /usr/local/lib

defaults:
run:
shell: bash -leo pipefail {0}

jobs:
build:
uses: ./.github/workflows/build.yaml
Expand All @@ -23,7 +27,7 @@ jobs:
strategy:
matrix:
package: [ acstools, asdf, calcos, ccdproc, costools, synphot, jwst ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
- package: acstools
Expand Down Expand Up @@ -64,12 +68,7 @@ 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 pipefail {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 @@ -122,7 +121,7 @@ jobs:
strategy:
matrix:
package: [ reftools, wfpc2tools ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
#- package: pysynphot
Expand All @@ -142,12 +141,7 @@ 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 pipefail {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 @@ -183,7 +177,7 @@ jobs:
strategy:
matrix:
package: [ hstcal ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
#- package: drizzlepac
Expand Down Expand Up @@ -212,12 +206,7 @@ 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 pipefail {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 @@ -275,7 +264,7 @@ jobs:
strategy:
matrix:
package: [ crds ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
- package: crds
Expand All @@ -292,12 +281,7 @@ 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 pipefail {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 @@ -343,7 +327,7 @@ jobs:
strategy:
matrix:
package: [ calcos, drizzlepac ]
runs-on: [ ubuntu-latest, macos-latest, macos-14, windows-latest ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
python-version: [ '3.9', '3.10', '3.11' ]
include:
- package: calcos
Expand All @@ -368,12 +352,7 @@ 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 pipefail {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 e3dfa11

Please sign in to comment.