-
Notifications
You must be signed in to change notification settings - Fork 21
52 lines (43 loc) · 1.48 KB
/
register-schemas-dryrun.yaml
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
on: [pull_request]
name: Register schemas (dry run)
env:
RENV_PATHS_ROOT: ~/.local/share/renv
SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_PAT }}
jobs:
register-schemas-dryrun:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2'
- name: Cache packages
uses: actions/cache@v1
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Restore packages
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
install.packages("sys")
renv::restore()
- name: Set up Synapse config file for testing
run: |
OUTPUT_FILE=~/.synapseConfig
cat > "$OUTPUT_FILE" << EOM
[authentication]
authtoken = "${{ secrets.SYNAPSE_PAT }}"
EOM
chmod +x "$OUTPUT_FILE"
- name: Get file changes
id: get_file_changes
uses: trilom/[email protected]
with:
output: ','
- name: Attempt to register schemas with dryRun = true
run: |
files="${{ steps.get_file_changes.outputs.files_added }},${{ steps.get_file_changes.outputs.files_modified }}"
echo $files | tr ',' '\n' | grep -Z '^terms.*\.json$' | xargs ./register-schemas.R --dryRun