ctbk.yml #1
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: List or generate aggregate data using `ctbk aggregate` | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
year: | ||
description: "Group by \"year\"" | ||
type: boolean | ||
month: | ||
description: "Group by \"month\"" | ||
type: boolean | ||
day: | ||
description: "Group by \"day\"" | ||
type: boolean | ||
weekday: | ||
description: "Group by \"weekday\"" | ||
type: boolean | ||
hour: | ||
description: "Group by \"hour\"" | ||
type: boolean | ||
region: | ||
description: "Group by \"region\"" | ||
type: boolean | ||
gender: | ||
description: "Group by \"gender\"" | ||
type: boolean | ||
user_type: | ||
description: "Group by \"user_type\"" | ||
type: boolean | ||
rideable_type: | ||
description: "Group by \"rideable_type\"" | ||
type: boolean | ||
start_station: | ||
description: "Group by \"start_station\"" | ||
type: boolean | ||
end_station: | ||
description: "Group by \"end_station\"" | ||
type: boolean | ||
count: | ||
description: "Aggregate by \"count\"" | ||
type: boolean | ||
duration: | ||
description: "Aggregate by \"duration\"" | ||
type: boolean | ||
subcommand: | ||
description: "Subcommand" | ||
type: choice | ||
options: | ||
- urls | ||
- create | ||
jobs: | ||
dispatch: | ||
name: List or generate aggregate data using `ctbk aggregate` | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
cache: 'pip' | ||
- run: pip install -e . | ||
- env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: us-east-1 | ||
run: | | ||
g= | ||
g="$g${{ inputs.year && 'y' || '' }}" | ||
g="$g${{ inputs.month && 'm' || '' }}" | ||
g="$g${{ inputs.day && 'd' || '' }}" | ||
g="$g${{ inputs.weekday && 'w' || '' }}" | ||
g="$g${{ inputs.hour && 'h' || '' }}" | ||
g="$g${{ inputs.region && 'r' || '' }}" | ||
g="$g${{ inputs.gender && 'g' || '' }}" | ||
g="$g${{ inputs.user_type && 't' || '' }}" | ||
g="$g${{ inputs.rideable_type && 'b' || '' }}" | ||
g="$g${{ inputs.start_station && 's' || '' }}" | ||
g="$g${{ inputs.end_station && 'e' || '' }}" | ||
a= | ||
a="$g${{ inputs.count && 'c' || '' }}" | ||
a="$g${{ inputs.duration && 'd' || '' }}" | ||
ctbk --s3 aggregated -d${{ inputs.start }}-${{ inputs.end }} -g$g -a$a ${{ inputs.subcommand }} |