Examples #134
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
name: Examples | |
on: | |
push: | |
branches: [ master ] | |
tags: [ '*.*' ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
examples: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
R: [3.6, oldrel, release, devel ] | |
runs-on: ${{ matrix.os }} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: 11 | |
distribution: 'adopt' | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.R }} | |
- run: mkdir ${{ matrix.os }}-R${{ matrix.R }} | |
shell: bash | |
- if: matrix.os == 'macos-latest' | |
run: brew install automake | |
- if: matrix.os == 'macos-latest' && matrix.R == '3.6' | |
run: | | |
ln -s /Library/Frameworks/R.framework/Versions/3.6 /Library/Frameworks/R.framework/Versions/3.5 | |
echo "/Library/Frameworks/R.framework/Resources/bin" >> $GITHUB_PATH | |
- if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
run: sudo R CMD javareconf | |
- if: matrix.os == 'ubuntu-latest' | |
run: sudo apt install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev | |
- run: | | |
Rscript -e "if (R.Version()[['os']]!='linux-gnu') options(install.packages.compile.from.source='never'); install.packages('remotes', repos = 'https://cloud.r-project.org'); download.file('https://raw.githubusercontent.com/Funz/Funz.R/master/DESCRIPTION','DESCRIPTION'); remotes::install_deps(dependencies=TRUE)" > ${{ matrix.os }}-R${{ matrix.R }}/install.Rout; \ | |
Rscript -e "install.packages('devtools', repos= 'https://cloud.r-project.org'); devtools::install_github('Funz/Funz.R',dependencies=FALSE, INSTALL_opts=c('--no-multiarch'))" > ${{ matrix.os }}-R${{ matrix.R }}/install.Rout; \ | |
Rscript -e "library(Funz); install.Design('GradientDescent')" >> ${{ matrix.os }}-R${{ matrix.R }}/install.Rout | |
shell: bash | |
- if: ${{ runner.os == 'Windows' }} | |
run: Rscript -e "writeLines(gsub('.sh','.bat',fixed=T,readLines(file.path(Funz:::FUNZ_HOME,'calculator.xml'))),file.path(Funz:::FUNZ_HOME,'calculator.xml'))" >> ${{ matrix.os }}-R${{ matrix.R }}/install.Rout | |
- run: Rscript -e "library('Funz'); calcs = startCalculators(5); Sys.sleep(3600)" > ${{ matrix.os }}-R${{ matrix.R }}/Calcs.Rout & | |
shell: bash | |
- run: Rscript -e "library('Funz'); Run(model = 'R',input.files = file.path(Funz:::FUNZ_HOME,'samples','branin.R'),input.variables = list(x1=seq(0,1,by=0.2),x2=seq(0,1,by=0.2)),all.combinations=TRUE,output.expressions = 'z', archive.dir='${{ matrix.os }}-R${{ matrix.R }}/Run')" > ${{ matrix.os }}-R${{ matrix.R }}/Run.Rout | |
shell: bash | |
- run: Rscript -e "library('Funz'); Design(fun = function(X){colnames(X)=c('x1','x2');print(X);abs(X\$x1*X\$x2)}, design = 'GradientDescent', options = list(max_iterations=10),input.variables = list(x1='[0,1]',x2='[1,2]'), archive.dir='${{ matrix.os }}-R${{ matrix.R }}/Design')" > ${{ matrix.os }}-R${{ matrix.R }}/Design.Rout | |
shell: bash | |
- run: Rscript -e "library('Funz'); RunDesign(model='R',input.files=file.path(Funz:::FUNZ_HOME,'samples','branin.R'),output.expressions='z', design = 'GradientDescent',design.options = list(max_iterations=10),input.variables = list(x1='[0,1]',x2='[0,1]'), archive.dir='${{ matrix.os }}-R${{ matrix.R }}/RunDesign')" > ${{ matrix.os }}-R${{ matrix.R }}/RunDesign.Rout | |
shell: bash | |
- uses: actions/upload-artifact@v2 | |
if: ${{ always() }} | |
with: | |
path: ./${{ matrix.os }}-* |