-
Notifications
You must be signed in to change notification settings - Fork 2
1159 lines (1151 loc) · 42.1 KB
/
build-and-release.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'on':
workflow_dispatch: ~
schedule:
- cron: 25 5 * * 1
name: build-and-release
jobs:
build_pfaedle:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
repository: stupidpupil/pfaedle
submodules: yes
path: pfaedle
ref: macos-patches
- name: Get pfaedle ref
id: pfaedle-ref
run: |
echo "ref=$(git -C pfaedle rev-parse HEAD)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache pfaedle-build
id: cache_pfaedle_build
uses: actions/cache@v3
with:
path: |
pfaedle-build
key: ${{ runner.os }}-${{ steps.pfaedle-ref.outputs.ref }}-v3
- name: Build pfaedle
if: steps.cache_pfaedle_build.outputs.cache-hit != 'true'
run: |
cd pfaedle
mkdir build
cd build
cmake ..
make -j
make install DESTDIR="../../pfaedle-build"
cd ../../
chmod -R ug+rw pfaedle-build/
shell: bash
- name: Upload pfaedle artefact
uses: actions/upload-artifact@v3
with:
name: pfaedle
path: pfaedle-build
if-no-files-found: error
build_osrm:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
repository: 'Project-OSRM/osrm-backend'
path: 'osrm-backend'
ref: '204fdaff6e83fe336db74a84db5adb3320a9a3ed'
- name: Get osrm-backend ref
id: osrm-backend-ref
run: |
echo "ref=$(git -C osrm-backend rev-parse HEAD)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache osrm-backend/build
id: cache_osrm_backend_build
uses: actions/cache@v3
with:
path: |
osrm-backend/build
osrm-backend/mason_packages
key: ${{ runner.os }}-${{ steps.osrm-backend-ref.outputs.ref }}-osrm-v2
- name: Build osrm-backend
if: steps.cache_osrm_backend_build.outputs.cache-hit != 'true'
run: |
cd osrm-backend
rm -rf build
mkdir build
cd build
cmake ../ -DENABLE_MASON=1
make
cd ../../
shell: bash
- name: Clean osrm-backend
run: |
rm -rf osrm-backend/build/CMakeFiles
rm -rf osrm-backend/build/libosrm*
rm -rf osrm-backend/build/flatbuffers-build
rm -rf osrm-backend/mason_packages/headers/
rm -rf osrm-backend/mason_packages/.binaries/
rm -rf osrm-backend/third_party/
rm -rf osrm-backend/unit_tests/
rm -rf osrm-backend/src/
rm -rf osrm-backend/docs/
rm -rf osrm-backend/features/
rm -rf osrm-backend/include/
rm -rf osrm-backend/test/
rm -rf osrm-backend/.git
rm -rf osrm-backend/.github
find osrm-backend -name "*.c" -type f -delete
find osrm-backend -name "*.cc" -type f -delete
find osrm-backend -name "*.h" -type f -delete
find osrm-backend -name "*.cpp" -type f -delete
find osrm-backend -name "*.hpp" -type f -delete
find osrm-backend -name "*.py" -type f -delete
find osrm-backend -name "*.md" -type f -delete
find osrm-backend -name "*.rst" -type f -delete
find osrm-backend -name "*.txt" -type f -delete
find osrm-backend -name "*.pbf" -type f -delete
find osrm-backend -name "*.rs" -type f -delete
find osrm-backend -name "*.png" -type f -delete
find osrm-backend -name "*.jpg" -type f -delete
shell: bash
- name: Upload osrm artefact
uses: actions/upload-artifact@v3
with:
name: osrm
path: osrm-backend
if-no-files-found: error
download_and_prepare_terrain:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Get Terrain 50 md5
id: terrain50_md5
run: |
echo "md5=$(curl "https://api.os.uk/downloads/v1/products/Terrain50/downloads" | jq '.[0].md5')" >> $GITHUB_OUTPUT
- name: Cache Terrain 50
id: cache_terrain50
uses: actions/cache@v3
with:
path: |
output/*terr50*
key: ${{ steps.terrain50_md5.outputs.md5 }}-${{ hashFiles('config.yml') }}-terr50-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_terrain50.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_terrain50.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_terrain50.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_terrain50.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_terrain50.outputs.cache-hit != 'true'
- name: Download terrain
if: steps.cache_terrain50.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_terrain50()
shell: Rscript {0}
- name: Prepare_terrain
if: steps.cache_terrain50.outputs.cache-hit != 'true'
run: |
devtools::load_all()
prepare_terrain50()
shell: Rscript {0}
- name: Upload Terrain 50 artifact
uses: actions/upload-artifact@v3
with:
name: terr50.tif
path: output/*terr50*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
download_and_prepare_osm:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Get Geofabrik ETag
id: geofabrik_etag
run: |
echo "etag=$(curl -I "https://download.geofabrik.de/europe/great-britain-latest.osm.pbf" | grep "ETag")" >> $GITHUB_OUTPUT
- name: Cache OSM
id: cache_osm
uses: actions/cache@v3
with:
path: |
output/openstreetmap/*
key: ${{ steps.geofabrik_etag.outputs.etag }}-${{ hashFiles('config.yml')
}}-osm-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_osm.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_osm.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_osm.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_osm.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_osm.outputs.cache-hit != 'true'
- name: Install osmium
run: brew install osmium-tool
if: steps.cache_osm.outputs.cache-hit != 'true'
- name: Download and prepare OSM
if: steps.cache_osm.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_and_prepare_osm()
shell: Rscript {0}
- name: Upload OpenStreetMap artifact
uses: actions/upload-artifact@v3
with:
name: openstreetmap
path: output/openstreetmap/*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
prepare_street_graph:
needs:
- download_and_prepare_terrain
- download_and_prepare_osm
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Download OpenStreetMap artifact
uses: actions/download-artifact@v3
with:
name: openstreetmap
path: output/openstreetmap/
- name: Download Terrain 50 artifact
uses: actions/download-artifact@v3
with:
name: terr50.tif
path: output
- name: Derive hash from ParochialCacheKeys
id: parochial_cache_keys
run: |-
echo "hash=$(
ls output/*/*.meta.json output/*.meta.json | sort | xargs jq .ParochialCacheKey | shasum -a 1
)" >> $GITHUB_OUTPUT
- name: Cache street graph
id: cache_street_graph
uses: actions/cache@v3
with:
path: output/opentripplanner/streetGraph.obj*
key: ${{ hashFiles('config.yml') }}-${{ steps.parochial_cache_keys.outputs.hash
}}-otp.street-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Download OTP
if: steps.cache_street_graph.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_otp()
shell: Rscript {0}
- name: Cache OTP elevation lookups
if: steps.cache_street_graph.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: data-raw/otp_cache/*
key: ${{ hashFiles('output/*terr50*') }}
- name: Install Java 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '17'
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Prepare street graph
if: steps.cache_street_graph.outputs.cache-hit != 'true'
run: |
devtools::load_all()
prepare_street_graph()
shell: Rscript {0}
- name: Upload street graph artifact
uses: actions/upload-artifact@v3
with:
name: streetGraph.obj
path: output/opentripplanner/streetGraph.obj*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
prepare_osrm_graph:
needs:
- build_osrm
- download_and_prepare_osm
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Download OpenStreetMap artifact
uses: actions/download-artifact@v3
with:
name: openstreetmap
path: output/openstreetmap/
- name: Download osrm artifact
uses: actions/download-artifact@v3
with:
name: osrm
path: osrm-backend
- name: Make osrm executable
run: |
chmod ug+x $GITHUB_WORKSPACE/osrm-backend/build/osrm-*
- name: Add osrm to path
run: echo "$GITHUB_WORKSPACE/osrm-backend/build" >> $GITHUB_PATH
- name: Derive hash from ParochialCacheKeys
id: parochial_cache_keys
run: |-
echo "hash=$(
ls output/*/*.meta.json output/*.meta.json | sort | xargs jq .ParochialCacheKey | shasum -a 1
)" >> $GITHUB_OUTPUT
- name: Cache OSRM graph
id: cache_street_graph
uses: actions/cache@v3
with:
path: output/osrm_driving/*
key: ${{ hashFiles('config.yml') }}-${{ steps.parochial_cache_keys.outputs.hash
}}-osrm_driving-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_street_graph.outputs.cache-hit != 'true'
- name: Prepare osrm graph
if: steps.cache_street_graph.outputs.cache-hit != 'true'
run: |
devtools::load_all()
prepare_osrm_graph()
shell: Rscript {0}
- name: Upload osrm outputs artifact
uses: actions/upload-artifact@v3
with:
name: osrm-graph
path: output/osrm_driving/*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
download_and_prepare_atoc:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
- name: Get ATOC URL
id: atoc_url
run: |
devtools::load_all()
cat(paste0("url=", get_atoc_download_url(),"\n"), file=Sys.getenv("GITHUB_OUTPUT"))
shell: Rscript {0}
- name: Cache ATOC
id: cache_atoc
uses: actions/cache@v3
with:
path: |
output/gtfs/atoc.*.gtfs.zip*
key: ${{ steps.atoc_url.outputs.url }}-${{ hashFiles('config.yml') }}-atoc.gtfs-v1
- name: Download and prepare ATOC GTFS
if: steps.cache_atoc.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_atoc()
prepare_atoc_gtfs() |>
parochial:::summarise_gtfs_as_markdown() |>
cat(file=Sys.getenv("GITHUB_STEP_SUMMARY"))
shell: Rscript {0}
- name: Upload ATOC GTFS artifact
uses: actions/upload-artifact@v3
with:
name: atoc.gtfs.zip
path: output/gtfs/atoc.*.gtfs.zip*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
download_and_prepare_tnds:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Get TNDS directory listing hash
id: tnds_dir_list_hash
run: |
echo "hash=$(
curl -s ftp://$TNDS_USERNAME:$TNDS_PASSWORD@ftp.tnds.basemap.co.uk | sort | shasum -a 1
)" >> $GITHUB_OUTPUT
- name: Cache TNDS
id: cache_tnds
uses: actions/cache@v3
with:
path: |
output/gtfs/*.tnds.*.gtfs.zip*
key: ${{ steps.tnds_dir_list_hash.outputs.hash }}-${{ hashFiles('config.yml')
}}-tnds.gtfs-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_tnds.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_tnds.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_tnds.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_tnds.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_tnds.outputs.cache-hit != 'true'
- name: Download and prepare TNDS GTFS
if: steps.cache_tnds.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_tnds()
prepare_tnds_gtfs() |>
parochial:::summarise_gtfs_as_markdown() |>
cat(file=Sys.getenv("GITHUB_STEP_SUMMARY"))
shell: Rscript {0}
- name: Upload TNDS GTFS artifact
uses: actions/upload-artifact@v3
with:
name: tnds.gtfs.zip
path: output/gtfs/*.tnds.*.gtfs.zip*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
download_and_prepare_bods:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Get BODS index page hash
id: bods_index_page_hash
run: |
echo "hash=$(curl "https://data.bus-data.dft.gov.uk/timetable/" | md5)" >> $GITHUB_OUTPUT
- name: Cache BODS
id: cache_bods
uses: actions/cache@v3
with:
path: output/gtfs/*.bods.*.gtfs.zip*
key: ${{ steps.bods_index_page_hash.outputs.hash }}-${{ hashFiles('config.yml')
}}-bods.gtfs-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_bods.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_bods.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_bods.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_bods.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_bods.outputs.cache-hit != 'true'
- name: Download and prepare BODS GTFS
if: steps.cache_bods.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_and_prepare_bods_gtfs() |>
parochial:::summarise_gtfs_as_markdown() |>
cat(file=Sys.getenv("GITHUB_STEP_SUMMARY"))
shell: Rscript {0}
- name: Upload BODS GTFS artifact
uses: actions/upload-artifact@v3
with:
name: bods.gtfs.zip
path: output/gtfs/*.bods.*.gtfs.zip*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
merge_and_pfaedle_gtfs:
needs:
- download_and_prepare_atoc
- download_and_prepare_tnds
- download_and_prepare_bods
- download_and_prepare_osm
- build_pfaedle
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Download ATOC GTFS artifact
uses: actions/download-artifact@v3
with:
name: atoc.gtfs.zip
path: output/gtfs
- name: Download TNDS GTFS artifact
uses: actions/download-artifact@v3
with:
name: tnds.gtfs.zip
path: output/gtfs
- name: Download BODS GTFS artifact
uses: actions/download-artifact@v3
with:
name: bods.gtfs.zip
path: output/gtfs
- name: Download OpenStreetMap artifact
uses: actions/download-artifact@v3
with:
name: openstreetmap
path: output/openstreetmap/
- name: Derive hash from ParochialCacheKeys
id: parochial_cache_keys
run: |-
echo "hash=$(
ls output/*/*.meta.json output/*.meta.json | sort | xargs jq .ParochialCacheKey | shasum -a 1
)" >> $GITHUB_OUTPUT
- name: Cache Merged GTFS
id: cache_merged_gtfs
uses: actions/cache@v3
with:
path: |
output/gtfs/merged.*.gtfs.zip*
key: ${{ hashFiles('config.yml') }}-${{ steps.parochial_cache_keys.outputs.hash
}}-merged.gtfs-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Install osmium
run: brew install osmium-tool
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Download pfaedle artifact
uses: actions/download-artifact@v3
with:
name: pfaedle
path: pfaedle-build
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Make pfaedle executable
run: |
chmod ug+x $GITHUB_WORKSPACE/pfaedle-build/usr/local/bin/*
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Add pfaedle to path
run: echo "$GITHUB_WORKSPACE/pfaedle-build/usr/local/bin" >> $GITHUB_PATH
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- uses: actions/setup-go@v3
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Get gtfstidy
run: go install github.com/patrickbr/gtfstidy@25d4d6d1079a5926d9a558546bbe36d5b4cdb45f
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
- name: Merge and Pfaedle Merged GTFS
if: steps.cache_merged_gtfs.outputs.cache-hit != 'true'
run: |
devtools::load_all()
prepare_merged_gtfs(should_pfaedle = TRUE)
shell: Rscript {0}
- name: Upload Merged GTFS artifact
uses: actions/upload-artifact@v3
with:
name: merged.gtfs.zip
path: output/gtfs/merged.*.gtfs.zip*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
prepare_pretty_map:
needs: merge_and_pfaedle_gtfs
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
- name: Download Merged GTFS artifact
uses: actions/download-artifact@v3
with:
name: merged.gtfs.zip
path: output/gtfs
- name: Prepare map
run: |
devtools::load_all()
prepare_pretty_map()
shell: Rscript {0}
- name: Upload map artifact
uses: actions/upload-artifact@v3
with:
name: map.png
path: output/map*.png*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
prepare_final_graph:
needs:
- download_and_prepare_osm
- prepare_street_graph
- merge_and_pfaedle_gtfs
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Download Merged GTFS artifact
uses: actions/download-artifact@v3
with:
name: merged.gtfs.zip
path: output/gtfs
- name: Download street graph artifact
uses: actions/download-artifact@v3
with:
name: streetGraph.obj
path: output/opentripplanner
- name: Derive hash from ParochialCacheKeys
id: parochial_cache_keys
run: |-
echo "hash=$(
ls output/*/*.meta.json output/*.meta.json | sort | xargs jq .ParochialCacheKey | shasum -a 1
)" >> $GITHUB_OUTPUT
- name: Cache transport graph
id: cache_transport_graph
uses: actions/cache@v3
with:
path: |
output/opentripplanner/graph.obj*
output/**/*.meta.json
key: ${{ hashFiles('config.yml') }}-${{ steps.parochial_cache_keys.outputs.hash
}}-otp.final-v1
- uses: r-lib/actions/setup-r@v2
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
- name: Download OTP
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
run: |
devtools::load_all()
download_otp()
shell: Rscript {0}
- name: Install Java 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '17'
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
- name: Prepare transport graph
if: steps.cache_transport_graph.outputs.cache-hit != 'true'
run: |
devtools::load_all()
prepare_transport_graph()
shell: Rscript {0}
- name: Upload transport graph artifact
uses: actions/upload-artifact@v3
with:
name: graph.obj
path: output/opentripplanner/graph.obj*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
prepare_r5r_network_dat:
needs:
- download_and_prepare_osm
- merge_and_pfaedle_gtfs
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Download OpenStreetMap artifact
uses: actions/download-artifact@v3
with:
name: openstreetmap
path: output/openstreetmap/
- name: Download Merged GTFS artifact
uses: actions/download-artifact@v3
with:
name: merged.gtfs.zip
path: output/gtfs
- name: Derive hash from ParochialCacheKeys
id: parochial_cache_keys
run: |-
echo "hash=$(
ls output/*/*.meta.json output/*.meta.json | sort | xargs jq .ParochialCacheKey | shasum -a 1
)" >> $GITHUB_OUTPUT
- name: Cache r5r network.dat
id: cache_network_dat
uses: actions/cache@v3
with:
path: |
output/r5r/network.dat*
key: ${{ hashFiles('config.yml') }}-${{ steps.parochial_cache_keys.outputs.hash
}}-r5r-v2
- uses: r-lib/actions/setup-r@v2
if: steps.cache_network_dat.outputs.cache-hit != 'true'
- uses: r-lib/actions/setup-pandoc@v2
if: steps.cache_network_dat.outputs.cache-hit != 'true'
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
if: steps.cache_network_dat.outputs.cache-hit != 'true'
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
if: steps.cache_network_dat.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE)
shell: Rscript {0}
if: steps.cache_network_dat.outputs.cache-hit != 'true'
- name: Install Java 11
if: steps.cache_network_dat.outputs.cache-hit != 'true'
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '11'
- name: Prepare r5r network.dat
if: steps.cache_network_dat.outputs.cache-hit != 'true'
run: |
devtools::load_all()
prepare_r5r_network_dat()
shell: Rscript {0}
- name: Upload r5r network.dat artifact
uses: actions/upload-artifact@v3
with:
name: network.dat
path: output/r5r/network.dat*
if-no-files-found: error
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
ATOC_USERNAME: ${{ secrets.ATOC_USERNAME }}
ATOC_PASSWORD: ${{ secrets.ATOC_PASSWORD }}
TNDS_USERNAME: ${{ secrets.TNDS_USERNAME }}
TNDS_PASSWORD: ${{ secrets.TNDS_PASSWORD }}
BOUNDS: ${{ secrets.BOUNDS }}
OUTPUT_AFFIX: ${{ secrets.OUTPUT_AFFIX }}
release:
needs:
- prepare_r5r_network_dat
- prepare_osrm_graph
- prepare_pretty_map
- prepare_final_graph
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Write config.yml
uses: DamianReeves/write-file-action@v1.2
with:
path: ${{ github.workspace }}/config.yml
contents: |
default:
atoc_username: !expr Sys.getenv("ATOC_USERNAME")
atoc_password: !expr Sys.getenv("ATOC_PASSWORD")
tnds_username: !expr Sys.getenv("TNDS_USERNAME")
tnds_password: !expr Sys.getenv("TNDS_PASSWORD")
output_affix: !expr Sys.getenv("OUTPUT_AFFIX")
bounds: !expr Sys.getenv("BOUNDS")
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds')
}}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_deps(dependencies = TRUE, type = "binary")
shell: Rscript {0}
- name: Install Java 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '17'
- name: Download OTP
run: |
devtools::load_all()
download_otp()
shell: Rscript {0}
- name: Download Terrrain 50 artifact
uses: actions/download-artifact@v3
with:
name: terr50.tif