-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (81 loc) · 2.52 KB
/
ctbk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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 }}