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

Improve ci workflows #127

Merged
merged 10 commits into from
Jul 25, 2024
Merged
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
38 changes: 38 additions & 0 deletions .github/workflows/create_test_conda_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: create_test_conda_env

on: [push]

jobs:
build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>=3.9'

- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH

- name: Create fre-cli environment
run: |
# create environment fre-cli will be installed into
conda env create -f environment.yml --name fre-cli
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
# install fre-cli w pip
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli .

- name: Run pytest in fre-cli environment
run: |
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
which python
python --version
$CONDA/envs/fre-cli/bin/python --version
# run pytest
$CONDA/envs/fre-cli/bin/pytest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
jobs:
build_and_publish:
publish:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:latest
Expand Down
8 changes: 7 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ channels:
- noaa-gfdl
dependencies:
- python
- pip
- click
- pyyaml
- pylint
- jsonschema
- noaa-gfdl::intakebuilder
- conda-forge::cylc-flow
- conda-forge::cylc-flow>=8.2.0
- conda-forge::cylc-rose
- conda-forge::metomi-rose
- conda-forge::cmor
- conda-forge::cylc-uiserver
- conda-forge::pytest
- conda-forge::pytest-cov
- conda-forge::python-cdo
- conda-forge::cdo>=2.0.0
Loading