-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
57 lines (57 loc) · 2.03 KB
/
action.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
name: 'Validate GTFS feed with MD Validator'
description: 'Validate a GTFS feed using the canonical GTFS validator provided by MobilityData'
inputs:
gtfs_path:
required: true
description: 'Path to the GTFS feed to validate'
md_validator_version:
required: false
description: 'Version of the MobilityData validator to install'
default: '5.0.1'
validation_results_path:
required: false
description: 'Path to write the GTFS validation report'
default: 'validation-results'
java_version:
required: false
description: 'Version of Java to install'
default: '17'
node_version:
required: false
description: 'Version of NodeJS to install'
default: '20'
runs:
using: composite
steps:
- name: Set GitHub Path
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: ${{ inputs.java_version }}
- name: Get validator
shell: bash
run: |
curl -sSL https://github.com/MobilityData/gtfs-validator/releases/download/v$MD_VALIDATOR_VERSION/gtfs-validator-$MD_VALIDATOR_VERSION-cli.jar -o gtfs-validator.jar
env:
MD_VALIDATOR_VERSION: ${{ inputs.md_validator_version }}
- name: Run validator
shell: bash
run: |
java -jar gtfs-validator.jar -i $GTFS_PATH -o $VALIDATION_RESULTS_PATH
env:
GTFS_PATH: ${{ inputs.gtfs_path }}
VALIDATION_RESULTS_PATH: ${{ inputs.validation_results_path }}
- name: Check validation results
shell: bash
run: |
node $GITHUB_ACTION_PATH/check-validation-results.mjs $VALIDATION_RESULTS_PATH/report.json $GITHUB_STEP_SUMMARY
env:
VALIDATION_RESULTS_PATH: ${{ inputs.validation_results_path }}
GITHUB_ACTION_PATH: ${{ github.action_path }}