Skip to content

Commit

Permalink
convert CI to conda and create environment artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
RHammond2 committed Oct 29, 2024
1 parent cf50afc commit 9be0f38
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- uses: actions/checkout@v4
- name: Set up Miniconda Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
activate-environment: greenheart-test-${{ matrix.python-version }}
- name: Install dependencies
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
Expand All @@ -30,6 +36,15 @@ jobs:
touch .env
# echo NREL_API_KEY=${{ secrets.NREL_API_KEY }} >> .env
# cat .env
- name: Save environment build details
run: |
mkdir ~/artifacts
conda env export --file ~/artifacts/environment.yml
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python-version }}-environment
path: ~/artifacts/environment.yml
- name: Run tests
run: |
PYTHONPATH=. pytest tests
Expand Down

0 comments on commit 9be0f38

Please sign in to comment.