-
Notifications
You must be signed in to change notification settings - Fork 67
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 #170 from NCAR/github_actions
Added Github Actions workflow for CI tests
- Loading branch information
Showing
10 changed files
with
16,549 additions
and
71 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
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
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
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
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,80 @@ | ||
#!/bin/sh | ||
unsetopt EQUALS 2>/dev/null | ||
|
||
RECIPE_DIR="$(dirname "$0")" | ||
export SRC_DIR="$(cd `dirname ${RECIPE_DIR}`; pwd)" | ||
export RECIPE_DIR="${SRC_DIR}/$(basename "${RECIPE_DIR}")" | ||
|
||
cd ${SRC_DIR} | ||
|
||
#. "$(conda info --base)/etc/profile.d/conda.sh" | ||
eval "$(micromamba shell hook --shell=bash)" | ||
micromamba shell init --shell=bash --prefix=~/micromamba | ||
source activate ncl_build 2>/dev/null || micromamba activate ncl_build | ||
|
||
export PREFIX="${CONDA_PREFIX}" | ||
export CXXFLAGS="-fPIC $CXXFLAGS" | ||
export LDFLAGS="-L${PREFIX}/lib $LDFLAGS" | ||
export CPPFLAGS="-I${PREFIX}/include $CPPFLAGS" | ||
export CFLAGS="-I${PREFIX}/include $CFLAGS" | ||
|
||
if [ "$(uname)" = "Darwin" ]; then | ||
export CC="${CLANG}" | ||
export CPP="${CLANG} -E -traditional" | ||
export CXX="${CLANG}++" | ||
export FC | ||
|
||
if [ -d "/opt/X11" ]; then | ||
x11_lib="-L/opt/X11/lib" | ||
x11_inc="-I/opt/X11/include -I/opt/X11/include/freetype2" | ||
|
||
CAIROLIB="#define CAIROlib /opt/X11/lib/libcairo.2.dylib /opt/X11/lib/libfontconfig.1.dylib /opt/X11/lib/libpixman-1.0.dylib /opt/X11/lib/libfreetype.6.dylib -lXrender -lexpat -lpng -lz -liconv -lbz2 -lpthread" | ||
CAIROLIBUSER="#define CAIROlibuser /opt/X11/lib/libcairo.2.dylib /opt/X11/lib/libfontconfig.1.dylib /opt/X11/lib/libpixman-1.0.dylib /opt/X11/lib/libfreetype.6.dylib -lXrender -lexpat -lpng -lz -liconv -lbz2 -lpthread" | ||
else | ||
echo "No X11 libs found. Exiting..." 1>&2 | ||
exit | ||
fi | ||
|
||
LDFLAGS="-headerpad_max_install_names $LDFLAGS" | ||
conf_file=config/Darwin_Intel | ||
elif [ "$(uname)" = "Linux" ]; then | ||
export CC="$GCC" | ||
export CPP="${CPP} -traditional" | ||
export CXX="$GXX" | ||
export FC | ||
|
||
conf_file=config/LINUX | ||
fi | ||
|
||
export EXTRA_LDFLAGS="$LDFLAGS" | ||
|
||
export grib2_dir=${SRC_DIR}/external/g2clib-1.6.0 | ||
export EXTRA_INCLUDES=-I${grib2_dir} | ||
|
||
# fix malformed sed subsitutions | ||
sed -e 's/+/|/g' -i.backup ni/src/scripts/yMakefile | ||
sed -e 's/+/|/g' -i.backup ni/src/ncl/yMakefile | ||
|
||
|
||
# fix path to cpp in ymake -- we should fix this in NCL | ||
sed -e "s|^\( set cpp = \)/lib/cpp$|\1'$CPP'|g" -i.backup config/ymake | ||
|
||
|
||
# generate Site.local | ||
sed -e "s|\${PREFIX}|${PREFIX}|g" -e "s|\${x11_inc}|${x11_inc}|g" -e "s|\${x11_lib}|${x11_lib}|g" -e "s|\${CAIROLIB}|${CAIROLIB}|g" -e "s|\${CAIROLIBUSER}|${CAIROLIBUSER}|g" -e "s|\${grib2_dir}|${grib2_dir}|g" -e "s|\${CC}|${CC}|g" -e "s|\${FC}|${FC}|g" -e "s|\${CPP}|${CPP}|g" -e "s|\${CXX}|${CXX}|g" -e "s|\${LD}|${LD}|g" "${RECIPE_DIR}/Site.local.template" > config/Site.local | ||
|
||
patch -N -p1 < ${RECIPE_DIR}/grib2.patch >/dev/null 2>&1 | ||
|
||
echo -e "n\n" | ./Configure | ||
make Everything | ||
|
||
ACTIVATE_DIR="$PREFIX/etc/conda/activate.d" | ||
DEACTIVATE_DIR="$PREFIX/etc/conda/deactivate.d" | ||
|
||
mkdir -p "$ACTIVATE_DIR" | ||
mkdir -p "$DEACTIVATE_DIR" | ||
|
||
cp "$RECIPE_DIR/scripts/activate.sh" "$ACTIVATE_DIR/ncl-activate.sh" | ||
cp "$RECIPE_DIR/scripts/deactivate.sh" "$DEACTIVATE_DIR/ncl-deactivate.sh" | ||
|
||
conda list |
This file was deleted.
Oops, something went wrong.
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,80 @@ | ||
name: CI (conda) | ||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
- 'master' | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' # Daily “At 00:00” | ||
|
||
jobs: | ||
test: | ||
name: (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "macos-latest"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install tcsh and byacc (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install tcsh | ||
sudo apt-get install byacc | ||
|
||
- name: Install dependencies (Darwin) | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
brew update | ||
brew install --cask xquartz | ||
|
||
- name: Conda setup | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: ncl_build | ||
python-version: 3.7 | ||
channels: conda-forge | ||
|
||
- name: Conda install (Darwin) | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
conda env update --file .build/envs/Darwin.yml --prune | ||
|
||
- name: Conda install (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
conda env update --file .build/envs/Linux.yml --prune | ||
|
||
- name: Conda install additional dependencies | ||
run: | | ||
conda install -n ncl_build -c conda-forge imagemagick esmf | ||
|
||
- name: Conda install libgdal=2.4 | ||
run: | | ||
conda install -n ncl_build -c conda-forge libgdal=2.4 | ||
|
||
- name: Build ncl | ||
run: | | ||
bash .build/conda_build.sh | ||
|
||
- name: Run tests | ||
run: | | ||
test "`ncl -V`" = "`cat version`" | ||
git clone https://github.com/NCAR/ncl_ci_test | ||
cd ncl_ci_test | ||
source run_tests.bash |
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,76 @@ | ||
name: CI (mamba) | ||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
- 'master' | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' # Daily “At 00:00” | ||
|
||
jobs: | ||
test: | ||
name: (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "macos-latest"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install tcsh and byacc (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install tcsh | ||
sudo apt-get install byacc | ||
- name: Install dependencies (Darwin) | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
brew update | ||
brew install --cask xquartz | ||
- name: Create mamba environment (Darwin) | ||
if: matrix.os == 'macos-latest' | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
micromamba-version: "latest" | ||
environment-name: ncl_build | ||
environment-file: .build/envs/Darwin.yml | ||
|
||
- name: Create mamba environment (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
micromamba-version: "latest" | ||
environment-name: ncl_build | ||
environment-file: .build/envs/Linux.yml | ||
|
||
- name: Build ncl | ||
run: | | ||
bash .build/mamba_build.sh | ||
- name: Run tests | ||
run: | | ||
ncl -V | ||
test "`ncl -V`" = "`cat version`" | ||
git clone https://github.com/NCAR/ncl_ci_test | ||
cd ncl_ci_test | ||
bash run_tests.bash |
Oops, something went wrong.