Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build on WSL #148

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 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,15 +46,20 @@ 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 ]
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: bash -leo pipefail {0}
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
Expand All @@ -75,8 +73,8 @@ 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: 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 All @@ -91,3 +89,21 @@ 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: wget
- run: mkdir -p ~/micromamba-bin/
- run: wget -o ~/micromamba-bin/micromamba https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-linux-64 --no-check-certificate
- run: chmod +x ~/micromamba-bin/micromamba
- run: ~/micromamba-bin/micromamba shell --init bash
- run: micromamba env create --name stenv-wsl --file https://raw.githubusercontent.com/spacetelescope/stenv/main/environment.yaml


12 changes: 6 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ 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
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
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 Down Expand Up @@ -119,7 +119,6 @@ jobs:
unit_tests_via_package:
needs: [ build ]
strategy:
fail-fast: false
matrix:
package: [ reftools, wfpc2tools ]
runs-on: [ ubuntu-latest, macos-latest, macos-14 ]
Expand All @@ -139,6 +138,7 @@ 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 }})
steps:
Expand Down Expand Up @@ -262,7 +262,6 @@ 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 ]
Expand All @@ -279,6 +278,7 @@ 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 }})
steps:
Expand Down
Loading