Skip to content

Utilities for Automated Workflows

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

nflverse/nflverse-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nflverse.workflows

This is a nflverse internal package that is aimed to be used in GitHub actions. It's a zero dependency package for quick workflow setup where an easy way to compute current seasons or weeks is needed.

Usage

This is a basic example where we setup a runner to install R and the nflverse.workflows package and then query a range of seasons including the most recent season. The result is being written to the output variable seasons. This variable is then available to other jobs. The next job would be multiple runs because we passed a range of seasons and it is setup as a matrix workflow.

For a full example in production, see the current NGS workflow

jobs:
  setup:
    runs-on: ubuntu-latest
    name: setup
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    outputs:
      seasons: ${{ steps.query_seasons.outputs.seasons }}
    steps:
      - uses: r-lib/actions/setup-r@v2

      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          packages: nflverse/nflverse-workflows

      - id: query_seasons
        name: Query Seasons
        run: |
          seasons=$( Rscript -e 'nflverse.workflows::get_season_range(2016)' )
          echo "seasons=$seasons" >> "$GITHUB_OUTPUT"
  
  next_job:
    needs: setup
    name: Update ${{ matrix.season }} ${{ matrix.type }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        season: ${{ fromJson(needs.setup.outputs.seasons) }}
        type: ["passing", "rushing", "receiving"]
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NFLVERSE_UPDATE_SEASON: ${{ matrix.season }}
      NFLVERSE_UPDATE_TYPE: ${{ matrix.type }}

About

Utilities for Automated Workflows

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages