-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
189 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
name: test build deploy | ||
|
||
on: | ||
# push: | ||
# branches: | ||
# - main | ||
# - h5s_unlimited | ||
workflow_dispatch: | ||
|
||
env: | ||
PKG: 'Rhdf5lib' | ||
|
||
jobs: | ||
install-depdendencies: | ||
name: Install package dependencies | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Make R library | ||
run: mkdir -p ${RUNNER_TEMP}/R-lib | ||
|
||
- name: Cache Dependencies | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ runner.temp }}/R-lib | ||
key: R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }} | ||
restore-keys: | | ||
R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }} | ||
R_lib-ARM64- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GRCH_TOKEN }} | ||
|
||
- name: Run the build process with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64 | ||
options: | | ||
--platform linux/arm64 | ||
-v ${{ runner.temp }}/R-lib:/R-lib | ||
-v ${{ github.workspace }}/../:/build | ||
--env R_LIBS_USER=/R-lib | ||
--env PKG=${{ env.PKG }} | ||
run: | | ||
uname -a | ||
echo "options(Ncpus=4L, timeout = 300)" >> ~/.Rprofile | ||
Rscript -e "library(remotes)" -e "dev_package_deps('/build/${PKG}', dependencies = TRUE) |> update(upgrade = 'always')" | ||
check-arm64: | ||
name: Test package on ARM64 | ||
runs-on: ubuntu-22.04 | ||
needs: install-depdendencies | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Make R library | ||
run: mkdir -p ${RUNNER_TEMP}/R-lib | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Cache Dependencies | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ runner.temp }}/R-lib | ||
key: R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }} | ||
restore-keys: | | ||
R_lib-ARM64-${{ hashFiles('**/DESCRIPTION') }} | ||
R_lib-ARM64- | ||
- name: R CMD INSTALL | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64 | ||
options: | | ||
--platform linux/arm64 | ||
-v ${{ runner.temp }}/R-lib:/R-lib | ||
-v ${{ github.workspace }}/../:/build | ||
--env R_LIBS_USER=/R-lib | ||
--env PKG=${{ env.PKG }} | ||
--workdir /build | ||
run: | | ||
ls -l | ||
R CMD INSTALL ${PKG} &> ${PKG}.install-out.txt | ||
ls -l | ||
shell: bash | ||
|
||
- name: R CMD build | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64 | ||
options: | | ||
--platform linux/arm64 | ||
-v ${{ runner.temp }}/R-lib:/R-lib | ||
-v ${{ github.workspace }}/../:/build | ||
--env R_LIBS_USER=/R-lib | ||
--env PKG=${{ env.PKG }} | ||
--workdir /build | ||
run: | | ||
ls -l "${R_LIBS_USER}" | ||
R CMD build --keep-empty-dirs --no-resave-data ${PKG} | ||
ls -l | ||
- name: R CMD check | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64 | ||
options: | | ||
--platform linux/arm64 | ||
-v ${{ runner.temp }}/R-lib:/R-lib | ||
-v ${{ github.workspace }}/../:/build | ||
--env R_LIBS_USER=/R-lib | ||
--env PKG=${{ env.PKG }} | ||
--workdir /build | ||
run: | | ||
ls -l | ||
R CMD check --install=check:${PKG}.install-out.txt --library="${R_LIBS_USER}" --no-vignettes --timings ${PKG}*.tar.gz | ||
cat ${PKG}.install-out.txt | ||
ls -l | ||
- name: Build Package Binary | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/grimbough/bioc-with-tinytex:devel-arm64 | ||
options: | | ||
--platform linux/arm64 | ||
-v ${{ runner.temp }}/R-lib:/R-lib | ||
-v ${{ github.workspace }}/../:/build | ||
--env R_LIBS_USER=/R-lib | ||
--env PKG=${{ env.PKG }} | ||
--workdir /build | ||
run: | | ||
mkdir -p ${PKG}.buildbin-libdir | ||
R CMD INSTALL --build --library=${PKG}.buildbin-libdir ${PKG}*.tar.gz | ||
ls -l | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: my-artifact | ||
path: | | ||
~/**/*.tar.gz | ||
~/**/*.install-out.txt | ||
~/**/*.Rcheck | ||
if-no-files-found: warn | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
#!/bin/sh | ||
|
||
#untar the lib | ||
BASEPBNAME="hdf5" | ||
PBTGZNAME=hdf5_headers_1.10.7.tar.gz | ||
cd src | ||
if test -d ${BASEPBNAME}; then | ||
ARCH=`$R_HOME/bin/Rscript --no-echo -e 'cat(R.version$arch)'` | ||
|
||
if [ X$ARCH == Xx86_64 ] ; then | ||
#untar the lib | ||
BASEPBNAME="hdf5" | ||
PBTGZNAME=hdf5_headers_1.10.7.tar.gz | ||
cd src | ||
if test -d ${BASEPBNAME}; then | ||
echo 'found ' $BASEPBNAME ' header sources; using what is there.' | ||
else | ||
else | ||
echo "untarring $PBTGZNAME ..."; | ||
## we'll use Rscript to untar the file | ||
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "untar('wininclude/$PBTGZNAME')" | ||
fi; | ||
fi | ||
else | ||
if which lld >/dev/null 2>/dev/null ; then | ||
./configure LD=lld CPPFLAGS=-Wno-implicit-function-declaration $* | ||
else | ||
./configure $* | ||
fi | ||
|
||
cp src/Makevars src/Makevars.ucrt | ||
if which lld >/dev/null ; then | ||
sed -i -e 's!LDFLAGS=!LD=lld \0!g' \ | ||
-e "s!CPPFLAGS='!CPPFLAGS='-Wno-implicit-function-declaration!g" \ | ||
-e 's!PKG_LIBS = .*!\0 -ldl!g' \ | ||
src/Makevars.ucrt | ||
fi | ||
fi | ||
|