-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 2.1 KB
/
main.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
name: Mise à jour GTFS
on:
workflow_dispatch:
schedule:
- cron: "30 14 * * 1,3,5" # Runs on Monday, Wednesday and Friday at 14:30 UTC
env:
MD_VALIDATOR_VERSION: 5.0.1
GTFS_PATH: stq-qc-ca.gtfs.zip
jobs:
gtfs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "20"
- name: Prepare node
run: |-
npm install
npm run prepare
- name: Generate GTFS
run: node src/index.js
- id: vars
name: Set variables for pull request
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
timestamp=$(date -u)
# Set title and body for PR
echo "pr_timestamp=${timestamp}" >> $GITHUB_OUTPUT
echo "pr_title=Latest data: ${timestamp}" >> $GITHUB_OUTPUT
echo "pr_body=Les données ont été mises à jour!" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Latest data ${{steps.vars.outputs.pr_timestamp}}
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
branch: latest-gtfs
delete-branch: true
validate:
needs: gtfs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Get validator
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
- name: Run validator
run: |
java -jar gtfs-validator.jar -i $GTFS_PATH -o validation-results
- name: Check validation results
run: |
node tests/check-validation-results.js validation-results/report.json