Merge pull request #988 from Sage-Bionetworks/MasterPastures-patch-19 #112
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
on: | |
push: | |
branches: master | |
name: Register schemas & update tables | |
env: | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_PAT }} | |
jobs: | |
register-and-update: | |
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: Register schemas in Synapse | |
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 | |
- name: Update Synapse key-value table | |
run: | | |
Rscript ./update-annotations-table.R | |
- name: Update Synapse schema versions table | |
run: | | |
Rscript ./update-schema-version-table.R |