-
-
Notifications
You must be signed in to change notification settings - Fork 7
113 lines (91 loc) · 3.35 KB
/
dev-cmd-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# r cmd check workflow of the mlr3 ecosystem v0.2.0
# https://github.com/mlr-org/actions
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 4 * * 1'
name: dev-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: ubuntu-latest, r: 'release', dev-package: 'mlr-org/mlr3', 'mlr-org/mlr3pipelines', 'mlverse/torch', 'mlr-org/paradox'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- name: Set test environment variables (unix)
if: runner.os != 'Windows'
run: |
echo "TORCH_TEST=1" >> $GITHUB_ENV
echo "INCLUDE_IGNORED=1" >> $GITHUB_ENV
- name: Set test environment variables (windows)
if: runner.os == 'Windows'
run: |
echo "TORCH_TEST=1" >> $env:GITHUB_ENV
echo "INCLUDE_IGNORED=1" >> $env:GITHUB_ENV
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- name: Install dev versions
run: pak::pkg_install(c('${{ matrix.config.dev-package }}'))
shell: Rscript {0}
- name: Install torch
run: |
Rscript -e 'torch::install_torch()'
- name: Install further packages
run: |
Rscript -e 'install.packages("rappdirs")'
- name: Get torchvision package version (Linux/macOS)
if: runner.os != 'Windows'
id: get_package_version_unix
run: |
echo "TORCHVISION_PACKAGE_VERSION=$(Rscript -e 'cat(as.character(packageVersion("torchvision")))')" >> $GITHUB_ENV
- name: Get torchvision package version (Windows)
if: runner.os == 'Windows'
id: get_package_version_windows
run: |
$version = Rscript -e 'cat(as.character(packageVersion("torchvision")))'
echo "TORCHVISION_PACKAGE_VERSION=$version" >> $env:GITHUB_ENV
- name: Get torch cache path (Linux/macOS)
if: runner.os != 'Windows'
id: get_cache_path_unix
run: |
echo "TORCH_CACHE_PATH=$(Rscript -e 'cat(rappdirs::user_cache_dir("torch"))')" >> $GITHUB_ENV
- name: Get torch cache path (Windows)
if: runner.os == 'Windows'
id: get_cache_path_windows
run: |
$cachePath = Rscript -e 'cat(rappdirs::user_cache_dir("torch"))'
echo "TORCH_CACHE_PATH=$cachePath" >> $env:GITHUB_ENV
- name: Cache Torchvision Downloads
uses: actions/cache@v4
with:
path: ${{ env.TORCH_CACHE_PATH }}
key: ${{ runner.os }}-r-${{ env.TORCHVISION_PACKAGE_VERSION }}
- uses: r-lib/actions/check-r-package@v2
- uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true