fix #2934
Workflow file for this run
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
# A single CI script with github workflow to test NNPDF, and upload the conda package and documentation | |
name: Tests | |
on: [push] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.9", "3.10"] | |
include: | |
- os: ubuntu-latest | |
CONDA_OS: linux-64 | |
- os: macos-latest | |
CONDA_OS: osx-64 | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
NETRC_FILE: ${{ secrets.NETRC_FILE }} | |
NNPDF_SSH_KEY: ${{ secrets.NNPDF_SSH_KEY }} | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install macOS SDK | |
if: startsWith(matrix.os, 'macOS') | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
curl -L -O https://data.nnpdf.science/MacOSX10.9.sdk.tar.xz | |
tar xfz MacOSX10.9.sdk.tar.xz -C $CONDA_PREFIX | |
- name: Setup conda and install conda-build | |
shell: bash -l {0} | |
run: | | |
echo "$NETRC_FILE" | base64 --decode > ~/.netrc | |
conda install -n base conda-libmamba-solver | |
conda config --set solver libmamba | |
conda config --append channels conda-forge | |
conda config --prepend channels https://packages.nnpdf.science/public | |
conda config --set show_channel_urls true | |
conda activate test | |
conda install boa --yes | |
- name: Build recipe and run tests on linux | |
if: startsWith(matrix.os, 'ubuntu') | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
conda mambabuild -q conda-recipe | |
- name: Build recipe and run tests on macOS | |
if: startsWith(matrix.os, 'macOS') | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
export CONDA_BUILD_SYSROOT=$CONDA_PREFIX/MacOSX10.9.sdk | |
conda build -q conda-recipe | |
- name: Upload conda package to NNPDF server | |
if: github.ref == 'refs/heads/master' | |
shell: bash -l {0} | |
run: | | |
KEY=$( mktemp ) | |
echo "$NNPDF_SSH_KEY" | base64 --decode > "$KEY" | |
conda activate test | |
scp -i "$KEY" -o StrictHostKeyChecking=no\ | |
$CONDA_PREFIX/conda-bld/${{matrix.CONDA_OS}}/*.tar.bz2 \ | |
dummy@packages.nnpdf.science:~/packages/conda/${{matrix.CONDA_OS}} | |
- name: Build and upload sphinx documentation to NNPDF server | |
if: startsWith(matrix.os, 'ubuntu') && github.ref == 'refs/heads/master' && matrix.python-version == '3.9' | |
shell: bash -l {0} | |
run: | | |
KEY=$( mktemp ) | |
echo "$NNPDF_SSH_KEY" | base64 --decode > "$KEY" | |
conda activate test | |
conda install nnpdf --yes | |
cd doc/sphinx | |
make html | |
scp -r -i "$KEY" -o StrictHostKeyChecking=no\ | |
build/html/* \ | |
dummy@packages.nnpdf.science:~/sphinx-docs/ |