Skip to content

Commit 6156499

Browse files
authored
Merge pull request #75 from zivy/circleCIWorkflow
Add CircleCI configuration file
2 parents 5ad92a5 + 7b2a770 commit 6156499

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.circleci/config.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
version: 2.1
2+
3+
parameters:
4+
run_monthly_testing:
5+
type: boolean
6+
default: false
7+
8+
executors:
9+
linux:
10+
machine:
11+
image: ubuntu-2204:current
12+
environment:
13+
RUNNER_OS: linux
14+
resource_class: large
15+
macos-intel:
16+
macos:
17+
xcode: 15.0.0
18+
environment:
19+
RUNNER_OS: macos
20+
resource_class: macos.x86.medium.gen2
21+
macos-arm:
22+
macos:
23+
xcode: 15.0.0
24+
environment:
25+
RUNNER_OS: macos
26+
resource_class: macos.m1.medium.gen1
27+
28+
jobs:
29+
r-build:
30+
parameters:
31+
os:
32+
type: executor
33+
r-version:
34+
type: string
35+
executor: << parameters.os >>
36+
environment:
37+
R_LIBS: ~/Rlibs
38+
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
39+
steps:
40+
- checkout
41+
- run:
42+
name: Install R << parameters.r-version >>
43+
command: |
44+
if [ "$RUNNER_OS" == "macos" ]; then
45+
brew install r
46+
elif [ "$RUNNER_OS" == "linux" ]; then
47+
sudo apt-get -y update
48+
sudo apt-get install -y software-properties-common dirmngr
49+
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
50+
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
51+
sudo apt-get update
52+
sudo apt-get install -y r-base
53+
fi
54+
- run:
55+
name: System Dependencies
56+
command: |
57+
if [ "$RUNNER_OS" == "linux" ]; then
58+
sudo apt-get -y update
59+
sudo apt-get install -y libcurl4-openssl-dev libssh2-1-dev libharfbuzz-dev libfribidi-dev gh
60+
sudo rm -rf /var/lib/apt/lists/*
61+
fi
62+
- run:
63+
name: Configuration Information
64+
command: |
65+
mkdir -p ${R_LIBS}
66+
c++ --version
67+
cmake --version || echo "cmake not found"
68+
which R
69+
R --version
70+
- run:
71+
name: Install R packages
72+
command: |
73+
R -e "install.packages(c('remotes'), lib=c('${R_LIBS}'), repo='https://cloud.r-project.org/')"
74+
- run:
75+
name: Build and test
76+
no_output_timeout: 30m
77+
command: |
78+
set -x
79+
R -e "remotes::install_git(c('.'), lib=c('${R_LIBS}'), configure.vars=c('MAKEJ=2'))"
80+
81+
workflows:
82+
r-build-test:
83+
# Runs on: push to main, pull requests to main, manual trigger, and scheduled runs
84+
jobs:
85+
- r-build:
86+
matrix:
87+
parameters:
88+
r-version: ['4.4.1']
89+
os: ["macos-arm"]
90+
filters:
91+
branches:
92+
only:
93+
- main
94+
- /pull\/.*/ # Run on all pull request branches

0 commit comments

Comments
 (0)