Update get_occ_cube.yaml #55
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
name: download occurrence cube | ||
on: | ||
workflow_dispatch: # Manual | ||
push: | ||
branches: # Changes to GRIIS Checklist | ||
- "uat" | ||
paths: | ||
- "data/output/UAT_processing/data_input_checklist_indicators.tsv" | ||
schedule: | ||
- cron: '0 0 1 1-12 *' # 1st of the month 00:00 between january & december | ||
jobs: | ||
build-queries: | ||
runs-on: ${{ matrix.config.os }} | ||
name: build queries | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, r: "release" } | ||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | ||
amiabot: ${{ secrets.AMIABOT }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTOMATISATION }} | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
- name: Setup pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install linux libraries | ||
run: | | ||
sudo apt install libsodium-dev | ||
sudo apt-get install libcurl4-openssl-dev | ||
sudo apt-get install libgdal-dev libproj-dev | ||
sudo apt install libudunits2-dev | ||
sudo apt install --yes libharfbuzz-dev libfribidi-dev | ||
- name: install packages | ||
run: | | ||
source("src/get_cubes/install_packages_cube_base.R") | ||
source("src/get_cubes/install_packages_cube_extra.R") | ||
shell: Rscript {0} | ||
- name: create queries | ||
run: | | ||
source("src/get_cubes/run_build_queries.R") | ||
shell: Rscript {0} | ||
- name: upload queries | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./data/interim/cube_queries/* | ||
download-cubes: | ||
runs-on: ${{ matrix.config.os }} | ||
needs: build-queries | ||
name: download - cube - ${{ matrix.param_value }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, r: "release" } | ||
param_value: ["FAMILY", "GENUS", "SPECIES", "SUBSPECIES_FORM_VARIETY", "CLASS"] | ||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | ||
amiabot: ${{ secrets.AMIABOT }} | ||
gbif_user: ${{ secrets.GBIF_USER }} | ||
email: ${{ secrets.GBIF_EMAIL }} | ||
gbif_pwd: ${{ secrets.GBIF_PWD }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTOMATISATION }} | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
- name: Setup pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install linux libraries | ||
run: | | ||
sudo apt install libsodium-dev | ||
sudo apt-get install libcurl4-openssl-dev | ||
sudo apt-get install libgdal-dev libproj-dev | ||
sudo apt install libudunits2-dev | ||
sudo apt install --yes libharfbuzz-dev libfribidi-dev | ||
- name: install packages | ||
run: | | ||
source("src/get_cubes/install_packages_cube_base.R") | ||
source("src/get_cubes/install_packages_cube_extra.R") | ||
shell: Rscript {0} | ||
- name: download queries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./data/interim/cube_queries/ | ||
merge-multiple: true #to make sure artifacts are downloaded into correct folder and not /artifact-name | ||
- name: download cubes | ||
run: | | ||
Rscript -e "rmarkdown::render('src/get_cubes/download_cubes.Rmd', params = list(rank = '${{ matrix.param_value }}'), knit_root_dir = '../../')" | ||
- name: Upload cube artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: | | ||
${{ matrix.param_value == 'CLASS' && 'be_classes_cube_raw' || | ||
format('be_alientaxa_cube_{0}', matrix.param_value) }}.csv | ||
be_cube_metadata_${{ matrix.param_value }}.csv | ||
path: ./cube_data/ | ||
- name: Debug info | ||
run: | | ||
echo "matrix.param_value: ${{ matrix.param_value }}" | ||
cat src/get_cubes/download_cubes.Rmd | ||
compile-cubes: | ||
runs-on: ${{ matrix.config.os }} | ||
needs: download-cubes | ||
name: compile cubes | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, r: "release" } | ||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | ||
amiabot: ${{ secrets.AMIABOT }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTOMATISATION }} | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
- name: Setup pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install linux libraries | ||
run: | | ||
sudo apt install libsodium-dev | ||
sudo apt-get install libcurl4-openssl-dev | ||
sudo apt-get install libgdal-dev libproj-dev | ||
sudo apt install libudunits2-dev | ||
sudo apt install --yes libharfbuzz-dev libfribidi-dev | ||
- name: install packages | ||
run: | | ||
source("src/get_cubes/install_packages_cube_base.R") | ||
shell: Rscript {0} | ||
- name: download rank cubes artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: be_alientaxa_cube_* | ||
merge-multiple: true | ||
path: ./cube_data/ | ||
- name: List cube_data directory | ||
run: ls -R ./cube_data/ | ||
- name: compile cubes | ||
run: | | ||
source("src/get_cubes/run_compile_cubes.R") | ||
shell: Rscript {0} | ||
- name: upload occ cube | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: be_alientaxa_cube.csv | ||
path: ./cube_data/be_alientaxa_cube.csv | ||
compile-class-cube: | ||
runs-on: ${{ matrix.config.os }} | ||
needs: download-cubes | ||
name: compile class cube | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, r: "release" } | ||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | ||
amiabot: ${{ secrets.AMIABOT }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTOMATISATION }} | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
- name: Setup pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install linux libraries | ||
run: | | ||
sudo apt install libsodium-dev | ||
sudo apt-get install libcurl4-openssl-dev | ||
sudo apt-get install libgdal-dev libproj-dev | ||
sudo apt install libudunits2-dev | ||
sudo apt install --yes libharfbuzz-dev libfribidi-dev | ||
- name: install packages | ||
run: | | ||
source("src/get_cubes/install_packages_cube_base.R") | ||
shell: Rscript {0} | ||
- name: download class cube artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: be_classes_cube_raw.csv | ||
merge-multiple: true | ||
path: ./cube_data/ | ||
- name: List cube_data directory | ||
run: ls -R ./cube_data/ | ||
- name: compile class cube | ||
run: | | ||
source("src/get_cubes/run_compile_class_cube.R") | ||
shell: Rscript {0} | ||
- name: upload occ cube | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: be_classes_cube.csv | ||
path: ./cube_data/be_classes_cube.csv | ||
compile-cube-metadata: | ||
runs-on: ${{ matrix.config.os }} | ||
needs: download-cubes | ||
name: compile cube metadata | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, r: "release" } | ||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_TOKEN: ${{ secrets.AUTOMATISATION }} | ||
amiabot: ${{ secrets.AMIABOT }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AUTOMATISATION }} | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
- name: Setup pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install linux libraries | ||
run: | | ||
sudo apt install libsodium-dev | ||
sudo apt-get install libcurl4-openssl-dev | ||
sudo apt-get install libgdal-dev libproj-dev | ||
sudo apt install libudunits2-dev | ||
sudo apt install --yes libharfbuzz-dev libfribidi-dev | ||
- name: install packages | ||
run: | | ||
source("src/get_cubes/install_packages_cube_base.R") | ||
shell: Rscript {0} | ||
- name: download cube metadata artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: be_cube_metadata_* | ||
merge-multiple: true | ||
path: ./cube_data/ | ||
- name: List cube_data directory | ||
run: ls -R ./cube_data/ | ||
- name: compile cube metadata | ||
run: | | ||
source("src/get_cubes/run_compile_metadata.R") | ||
shell: Rscript {0} | ||
- name: upload cube metadata | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: be_cube_metadata.csv | ||
path: ./cube_data/be_cube_metadata.csv |