2020-12-18 17:03:58 +01:00
|
|
|
name: tests
|
2020-12-15 04:15:39 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-12-18 21:18:15 +01:00
|
|
|
branches-ignore:
|
|
|
|
- "master"
|
|
|
|
tags:
|
|
|
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "develop"
|
2020-12-18 20:06:28 +01:00
|
|
|
env:
|
|
|
|
RENV_PATHS_ROOT: ~/.local/share/renv
|
2020-12-15 04:15:39 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-on-latest-ubuntu:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-12-15 04:26:07 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-12-18 21:18:15 +01:00
|
|
|
- run: "sed -i 's/name:.*/name: rapidstests/g' environment.yml"
|
|
|
|
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
- run: echo "RELEASE_VERSION_URL=$(echo $RELEASE_VERSION | sed -e 's/\.//g')" >> $GITHUB_ENV
|
2020-12-15 04:15:39 +01:00
|
|
|
- run : |
|
|
|
|
sudo apt update
|
2021-01-06 01:03:42 +01:00
|
|
|
sudo apt install libglpk40
|
2020-12-18 21:18:15 +01:00
|
|
|
# sudo apt install libcurl4-openssl-dev
|
|
|
|
# sudo apt install libssl-dev
|
|
|
|
# sudo apt install libxml2-dev
|
2020-12-15 04:15:39 +01:00
|
|
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
|
|
|
|
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
|
|
|
|
sudo apt install r-base
|
2020-12-18 21:18:15 +01:00
|
|
|
- name: Cache R packages
|
2020-12-20 20:26:18 +01:00
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cacherenv
|
2020-12-18 20:06:28 +01:00
|
|
|
with:
|
|
|
|
path: ${{ env.RENV_PATHS_ROOT }}
|
|
|
|
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-renv-
|
2020-12-20 20:26:18 +01:00
|
|
|
- name: Install R dependencies
|
|
|
|
if: steps.cacherenv.outputs.cache-hit != 'true'
|
|
|
|
run: sudo apt install libcurl4-openssl-dev
|
2020-12-18 21:18:15 +01:00
|
|
|
- name: Restore R packages
|
2020-12-18 20:06:28 +01:00
|
|
|
shell: Rscript {0}
|
|
|
|
run: |
|
|
|
|
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
|
2021-01-06 00:43:19 +01:00
|
|
|
renv::restore(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/focal/latest"))
|
2020-12-18 21:18:15 +01:00
|
|
|
- name: Cache conda packages
|
|
|
|
uses: actions/cache@v1
|
|
|
|
env:
|
|
|
|
# Increase this value to reset cache if environment.yml has not changed
|
|
|
|
CACHE_NUMBER: 0
|
|
|
|
with:
|
|
|
|
path: ~/conda_pkgs_dir
|
|
|
|
key:
|
|
|
|
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
|
|
|
|
hashFiles('**/environment.yml') }}
|
|
|
|
- name: Restore conda packages
|
|
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
|
|
with:
|
|
|
|
activate-environment: rapidstests
|
|
|
|
environment-file: environment.yml
|
|
|
|
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
|
|
|
|
- name: Run tests
|
|
|
|
shell: bash -l {0}
|
|
|
|
run : |
|
|
|
|
conda activate rapidstests
|
|
|
|
bash tests/scripts/run_tests.sh all test
|
|
|
|
- name: Release tag
|
|
|
|
if: success() && startsWith(github.ref, 'refs/tags')
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
2021-01-06 00:36:33 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.RAPIDS_RELEASES_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
2020-12-18 21:18:15 +01:00
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
|
|
|
release_name: ${{ github.ref }}
|
|
|
|
body: |
|
|
|
|
See [change log](http://www.rapids.science/latest/change-log/#${{ env.RELEASE_VERSION_URL }})
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|