-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ilaflott/add_conda_environment_yaml
Add conda environment yaml
- Loading branch information
Showing
5 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: build_conda | ||
on: | ||
[push] | ||
# pull_request: | ||
# branches: | ||
# - FOOmainBAR | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: continuumio/miniconda3:latest | ||
steps: | ||
- name: Checkout Files | ||
uses: actions/checkout@v4 | ||
- name: Run Conda to Build | ||
run: | | ||
conda config --append channels conda-forge | ||
conda config --append channels noaa-gfdl | ||
conda install conda-build conda-verify | ||
git submodule update --init --recursive --remote | ||
git config --global --add safe.directory fms_yaml_tools/schema/gfdl_msd_schemas | ||
rm -rf fms_yaml_tools/schema/gfdl_msd_schemas/.git | ||
conda build . | ||
ls . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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 env var pointing to root of miniconda dir | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Create fms_yaml_tools environment | ||
run: | | ||
# create environment containing all dependencies | ||
# the env cannot be explicitly activated in github CI/CD | ||
conda env create -f environment.yml --name fms_yaml_tools | ||
# add conda env's executables to github's PATH equiv. | ||
echo $CONDA/envs/fms_yaml_tools/bin >> $GITHUB_PATH | ||
# get fms_yaml_tools/schema/gfdl_msd_schemas/FMS for unittest | ||
git submodule update --init --recursive --remote | ||
# use *conda environment's pip* to install fms_yaml_tools | ||
# called w/ full path to conda's python for explicitness | ||
# called as a module (-m pip) for explicitness | ||
$CONDA/envs/fms_yaml_tools/bin/python -m pip install --prefix $CONDA/envs/fms_yaml_tools . | ||
- name: Run unittest in fms_yaml_tools environment | ||
run: | | ||
# try to make sure the right things are in GITHUB_PATH | ||
echo $CONDA/envs/fms_yaml_tools/bin >> $GITHUB_PATH | ||
python -m unittest discover -s test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: publish_conda | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: continuumio/miniconda3:latest | ||
steps: | ||
- name: Checkout Files | ||
uses: actions/checkout@v4 | ||
- name: Run Conda to Build and Publish | ||
run: | | ||
conda config --append channels conda-forge | ||
conda config --append channels noaa-gfdl | ||
conda install conda-build anaconda-client conda-verify | ||
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }} | ||
conda config --set anaconda_upload yes | ||
git submodule update --init --recursive --remote | ||
conda build . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: fms_yaml_tools | ||
channels: | ||
- defaults | ||
- conda-forge | ||
- noaa-gfdl | ||
dependencies: | ||
- python | ||
- pip | ||
- click | ||
- pyyaml | ||
- pylint | ||
- jsonschema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package: | ||
name: fms_yaml_tools | ||
version: 'alpha' | ||
# version: '{{ environ.get("GIT_DESCRIBE_TAG", data.get("version")) }}' | ||
|
||
source: | ||
path: . | ||
|
||
build: | ||
script: | ||
- python3 -m pip install . -vv | ||
number: 1 | ||
noarch: python | ||
|
||
channels: | ||
- defaults | ||
- conda-forge | ||
- noaa-gfdl | ||
|
||
requirements: | ||
host: | ||
- python | ||
- pip | ||
run: | ||
- python | ||
- pip | ||
- click | ||
- pyyaml | ||
- pylint | ||
- jsonschema | ||
|
||
test: | ||
source_files: | ||
- fms_yaml_tools/ | ||
commands: | ||
- python -m unittest discover -s test | ||
|
||
about: | ||
home: https://github.com/NOAA-GFDL/fms_yaml_tools |