Skip to content

Commit

Permalink
Merge pull request #1 from iambaim/use_actions
Browse files Browse the repository at this point in the history
Use Actions
  • Loading branch information
iambaim authored Mar 14, 2021
2 parents 9b48dd7 + 2fe8102 commit 8ba34aa
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 152 deletions.
159 changes: 159 additions & 0 deletions .github/workflows/check-full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'oldrel', pkgext: '.tgz'}
- {os: macOS-latest, r: 'release', pkgext: '.tgz'}
- {os: windows-latest, r: 'oldrel', pkgext: '.zip', rtools: '35'}
- {os: windows-latest, r: 'release', pkgext: '.zip'}
- {os: ubuntu-18.04, r: 'release', pkgext: '.tar.gz', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'oldrel', pkgext: '.tar.gz', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- name: Do autorelease increment, tagging, and environment setup
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
curl "https://raw.githubusercontent.com/StoXProject/repo/master/scripts/checktag-actions.sh" --output checktag.sh
curl "https://raw.githubusercontent.com/StoXProject/repo/master/scripts/deploy-actions.sh" --output deploy.sh
chmod +x ./checktag.sh ./deploy.sh
. checktag.sh
echo "FINAL_TAG=${FINAL_TAG}" >> $GITHUB_ENV
echo "PKG_FILE_PREFIX=${PKG_FILE_PREFIX}" >> $GITHUB_ENV
echo "PKG_FILE=${PKG_FILE_PREFIX}${{ matrix.config.pkgext }}" >> $GITHUB_ENV
echo "PKG_FREL=${PKG_FILE_PREFIX}-R.${{ matrix.config.r }}-${{ runner.os }}${{ matrix.config.pkgext }}" >> $GITHUB_ENV
echo "PKG_REPO=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
shell: bash

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("git2r")
remotes::install_cran("drat")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Build package source archive
if: runner.os == 'Linux' && matrix.config.r == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
pkgbuild::build(".", dest_path = ".", binary = FALSE)
system(paste0("PKG_FREL=", Sys.getenv("PKG_FILE"), " >> ", Sys.getenv("GITHUB_ENV")))
shell: Rscript {0}

- name: Build package binary archive
if: (runner.os == 'Windows' || runner.os == 'macOS') && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
pkgbuild::build(".", dest_path = ".", binary = TRUE)
file.copy(Sys.getenv("PKG_FILE"), Sys.getenv("PKG_FREL"))
shell: Rscript {0}

# - name: Upload package source as artifact
# if: runner.os == 'Linux' && matrix.config.r == 'release'
# uses: actions/upload-artifact@master
# with:
# name: ${{ env.PKG_FILE }}
# path: '${{ github.workspace }}/${{ env.PKG_FILE }}'

# - name: Upload package binary as artifact
# if: runner.os == 'Windows' || runner.os == 'macOS'
# uses: actions/upload-artifact@master
# with:
# name: ${{ runner.os }}-${{ matrix.config.r }}-pkg
# path: '${{ github.workspace }}/*${{ matrix.config.pkgext }}'

- name: Upload to DRAT repo
if: (runner.os == 'Windows' || runner.os == 'macOS' || (runner.os == 'Linux' && matrix.config.r == 'release')) && github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
BUILD_NUMBER: ${{ github.sha }}
DRAT_DEPLOY_TOKEN: ${{ secrets.DRAT_DEPLOY_TOKEN }}
run: . deploy.sh
shell: bash

- name: Create release and upload files
if: (runner.os == 'Windows' || runner.os == 'macOS' || (runner.os == 'Linux' && matrix.config.r == 'release')) && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
commit: master
tag: ${{ env.FINAL_TAG }}
name: ${{ env.FINAL_TAG }}
artifacts: ${{ env.PKG_REPO }}/${{ env.PKG_FREL }}
token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
- master

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

85 changes: 0 additions & 85 deletions appveyor.yml

This file was deleted.

7 changes: 2 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ECA_CFLAGS = $(DEBUG_CFLAGS) -g -O3 $(INCLUDE)
LIB = -lpthread -lm
LFLAGS = $(LIBTAUCS) $(LIBMETIS) $(LIBBLAS)
BIN = .
CC = gcc
LD = $(CC)
FC = gfortran
LD = gfortran -static-libgcc
Expand All @@ -28,13 +29,9 @@ endif

# Whether to build universal openblas
OPENBLASFLAG =
ifeq ($(TRAVIS), true)
ifeq ($(CI), true)
OPENBLASFLAG = "DYNAMIC_ARCH=1"
endif
ifeq ($(APPVEYOR), True)
OPENBLASFLAG = "DYNAMIC_ARCH=1"
endif


# Required static libs
LIBF2CDIR = libs/f2c
Expand Down

0 comments on commit 8ba34aa

Please sign in to comment.