|
4 | 4 | types: [published] |
5 | 5 | jobs: |
6 | 6 | test: |
7 | | - name: Test on ${{ matrix.os }} |
| 7 | + name: ${{ matrix.lang }} tests on ${{ matrix.os }} |
8 | 8 | runs-on: ${{ matrix.os }} |
9 | 9 | strategy: |
10 | 10 | matrix: |
11 | 11 | os: [ubuntu-latest, macos-latest] |
| 12 | + lang: [Python, R] |
| 13 | + |
12 | 14 | steps: |
13 | 15 | - uses: actions/checkout@v2 |
| 16 | + |
14 | 17 | - name: Set up Python 2.x |
| 18 | + if: matrix.lang == 'Python' |
15 | 19 | uses: actions/setup-python@v1 |
16 | 20 | with: |
17 | 21 | python-version: '2.x' |
| 22 | + |
18 | 23 | - name: Install Python 2.x dependencies |
| 24 | + if: matrix.lang == 'Python' |
19 | 25 | run: | |
20 | 26 | python2 -m pip install --upgrade pip |
21 | 27 | python2 -m pip install tox |
| 28 | +
|
22 | 29 | - name: Set up Python 3.x |
23 | 30 | uses: actions/setup-python@v1 |
24 | 31 | with: |
25 | 32 | python-version: '3.x' |
| 33 | + |
26 | 34 | - name: Install Python 3.x dependencies |
27 | 35 | run: | |
28 | 36 | python3 -m pip install --upgrade pip |
29 | | - python3 -m pip install tox |
30 | | - - name: Test with tox |
| 37 | + python3 -m pip install tox numpy |
| 38 | + |
| 39 | + - name: Set up R 3.6 |
| 40 | + if: matrix.lang == 'R' |
| 41 | + uses: r-lib/actions/setup-r@v1 |
| 42 | + with: |
| 43 | + r-version: '3.6.3' |
| 44 | + |
| 45 | + - name: Install R 3.6 system dependencies |
| 46 | + if: matrix.lang == 'R' && matrix.os == 'ubuntu-latest' |
| 47 | + run: sudo apt-get update; sudo apt-get install -y libcurl4-openssl-dev qpdf |
| 48 | + |
| 49 | + - name: Install R 3.6 Rlang dependencies |
| 50 | + if: matrix.lang == 'R' |
| 51 | + run: | |
| 52 | + python3 -m pip install . |
| 53 | + Rscript -e 'install.packages("devtools", repos="https://cloud.r-project.org", Ncpus=8)' |
| 54 | + Rscript -e 'devtools::install_deps("R", dependencies=TRUE, repos="https://cloud.r-project.org", upgrade="default")' |
| 55 | + R CMD INSTALL R |
| 56 | + Rscript -e 'install.packages(c("data.table", "caret", "glmnet", "Matrix", "rjson"), repos="https://cloud.r-project.org", Ncpus=8)' |
| 57 | +
|
| 58 | + - name: Install latex for CRAN compatibility checks |
| 59 | + if: matrix.lang == 'R' && matrix.os == 'ubuntu-latest' |
| 60 | + uses: r-lib/actions/setup-tinytex@v1 |
| 61 | + |
| 62 | + - name: Check CRAN compatibility |
| 63 | + if: matrix.lang == 'R' && matrix.os == 'ubuntu-latest' |
| 64 | + run: | |
| 65 | + cd R/ |
| 66 | + bash ./check_as_cran.sh |
| 67 | +
|
| 68 | + - name: Execute R tests |
| 69 | + if: matrix.lang == 'R' |
| 70 | + run: | |
| 71 | + cd R/tests |
| 72 | + Rscript testthat.R |
| 73 | + Rscript run_integration_tests.R |
| 74 | +
|
| 75 | + - name: Execute Python tests |
| 76 | + if: matrix.lang == 'python' |
31 | 77 | run: tox |
| 78 | + |
32 | 79 | deploy: |
33 | 80 | needs: test |
34 | 81 | runs-on: ubuntu-latest |
|
0 commit comments