Skip to content

Update linux.yml

Update linux.yml #91

Workflow file for this run

name: linux
on: [push]
jobs:
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# 18.04 supports CUDA 10.1+ (gxx <= 8)
- os: ubuntu-18.04
cuda: "10.1"
gcc: 8
# 16.04 supports CUDA 8+
#- os: ubuntu-16.04
# cuda: "10.1"
# gcc: 7
#- os: ubuntu-16.04
# cuda: "9.2"
# gcc: 7
#- os: ubuntu-16.04
# cuda: "9.1"
# gcc: 6
max-parallel: 5
env:
build_dir: "build"
config: "Release"
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 4.6.14
activate-environment: larix
python-version: 3.7
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install CUDA
env:
cuda: ${{ matrix.cuda }}
run: |
source ./scripts/actions/install_cuda_ubuntu.sh
if [[ $? -eq 0 ]]; then
# Set paths for subsequent steps, using ${CUDA_PATH}
echo "Adding CUDA to CUDA_PATH, PATH and LD_LIBRARY_PATH"
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
fi
shell: bash
# Specify the correct host compilers
- name: Install/Select gcc and g++
run: |
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
- name: Configure cmake
id: configure
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }}
- name: Configure Error Processing
if: ${{ failure() && steps.configure.outcome == 'failure' }}
working-directory: ${{ env.build_dir }}
run: |
if [[ -f "CMakeFiles/CMakeOutput.log" ]]; then
echo "---- CMakeFiles/CMakeOutput.log"
cat CMakeFiles/CMakeOutput.log
echo "----"
fi
if [[ -f "CMakeFiles/CMakeError.log" ]]; then
echo "---- CMakeFiles/CMakeError.log"
cat CMakeFiles/CMakeError.log
echo "----"
fi
- name: Lint with flake8
shell: bash -l {0}
run: |
conda activate /usr/share/miniconda3/envs/larix
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Building and installing larix package
shell: bash -l {0}
run: |
conda install --yes numpy anaconda-client setuptools cython cmake pytest
conda install --yes conda-build
conda info
export VERSION=`date +%Y.%m`
conda-build recipe/ --numpy=1.15 --python=3.7
conda install --channel /usr/share/miniconda3/envs/larix/conda-bld/linux-64/ larix --offline --override-channels
- name: Test with pytest
shell: bash -l {0}
run: |
conda activate /usr/share/miniconda3/envs/larix
pytest tests/
- name: Decrypt a secret
run: ./scripts/decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
- name: Upload the tested package to conda cloud
shell: bash -l {0}
run: |
conda activate /usr/share/miniconda3/envs/larix
chmod +x ./scripts/conda_upload.sh
./scripts/conda_upload.sh