Skip to content

Commit

Permalink
CI: Add logic to auto update input data (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored Feb 11, 2022
1 parent 0f25d3c commit 1d56b26
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,26 @@ jobs:
path: ${{ runner.workspace }}/logs
if-no-files-found: ignore

update_input_data:
name: Update input data volumes
runs-on: ubuntu-latest
needs: [job_control]
if: ${{ needs.job_control.outputs.run_unit_tests == 'true' }}
steps:
- uses: dtcenter/metplus-action-data-update@v1
with:
docker_name: ${{ secrets.DOCKER_USERNAME }}
docker_pass: ${{ secrets.DOCKER_PASSWORD }}
repo_name: ${{ github.repository }}
data_prefix: unit_test
branch_name: ${{ needs.job_control.outputs.branch_name }}
docker_data_dir: /data/input/MET_test_data
data_repo_dev: met-data-dev

unit_1a:
name: Unit 1a
runs-on: ubuntu-latest
needs: [job_control, compile]
needs: [job_control, update_input_data, compile]
if: ${{ needs.job_control.outputs.run_unit_tests == 'true' }}
strategy:
matrix:
Expand All @@ -107,7 +123,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
TESTS: ${{ matrix.tests }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}-all

- name: Upload output as artifact
uses: actions/upload-artifact@v2
Expand All @@ -126,7 +142,7 @@ jobs:
unit_1b:
name: Unit 1b
runs-on: ubuntu-latest
needs: [job_control, compile]
needs: [job_control, update_input_data, compile]
if: ${{ needs.job_control.outputs.run_unit_tests == 'true' }}
strategy:
matrix:
Expand All @@ -142,7 +158,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
TESTS: ${{ matrix.tests }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}-all

- name: Upload output as artifact
uses: actions/upload-artifact@v2
Expand All @@ -161,7 +177,7 @@ jobs:
unit_rc_leads:
name: Unit RC leads
runs-on: ubuntu-latest
needs: [job_control, compile]
needs: [job_control, update_input_data, compile]
if: ${{ needs.job_control.outputs.run_unit_tests == 'true' }}
strategy:
matrix:
Expand All @@ -178,7 +194,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
TESTS: ${{ matrix.tests }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}-all

- name: Upload output as artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -261,7 +277,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
TESTS: ${{ matrix.tests }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}-all

- name: Upload output as artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -304,7 +320,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
TESTS: ${{ matrix.tests }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}
INPUT_DATA_VERSION: ${{ needs.job_control.outputs.input_data_version }}-all

- name: Upload output as artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 1d56b26

Please sign in to comment.