Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify viash-test #1

Open
rcannood opened this issue Dec 7, 2022 · 0 comments
Open

Simplify viash-test #1

rcannood opened this issue Dec 7, 2022 · 0 comments
Assignees

Comments

@rcannood
Copy link
Member

rcannood commented Dec 7, 2022

Implement the necessary actions to be able to create an action somewhat like this:

  list_components:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.list_components.outputs.json }}
      cachehash: ${{ steps.sync_resources.outputs.cachehash }}
    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0 

    - uses: viash-io/viash-actions/setup@v1

    - id: sync_resources
      uses: viash-io/viash-actions/sync-and-cache@v1
      with:
        bucket: s3://openpipelines-data/
        path: resources_test

    - id: list_components
      uses: viash-io/viash-actions/list-changed-components@v1
      with:
        base-branch: main
    # outputs a json list of component configs
  
  viash_test:
    runs-on: ubuntu-latest
    needs: list_components
    if: ${{ needs.list_components.outputs.matrix != '[]' && needs.list_components.outputs.matrix != '' }}

    strategy:
      fail-fast: false
      matrix:
        component: ${{ fromJson(needs.list_components.outputs.matrix) }}

    steps:
    - uses: actions/checkout@v3

    - uses: viash-io/viash-actions/setup@v1

    - name: Cache resources data
      uses: actions/cache@v3
      timeout-minutes: 5
      with:
        path: resources_test
        key: ${{ needs.list_components.outputs.cachehash }}

    - name: Run test
      timeout-minutes: 30
      run: |
        bin/viash test -p docker ${{ matrix.component.info.config }} \
         -c '.functionality.requirements.cpus := 2' \
         -c '.functionality.requirements.memory := "5gb"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants