generated from Railway-Op-Sim/UN-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (81 loc) · 2.99 KB
/
ros_ttbcheck_ci.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Timetable Check
on: push
jobs:
prepare-checker:
name: Prepare Timetable checker
runs-on: ubuntu-latest
container:
image: artemisbeta/railwayopsim-ci:latest
env:
DEBIAN_FRONTEND : noninteractive
LANG : 'en_GB.UTF-8'
LANGUAGE : 'en_GB:en'
LC_ALL : 'en_GB.UTF-8'
steps:
- name: Download Timetable Checker
run: git clone https://github.com/Railway-Op-Sim/CI-Development.git
- name: Check Contents
run: |
pwd
ls CI-Development/software
- uses: actions/upload-artifact@v1
with:
name: ttb_checker_exe_archive
path: CI-Development/software/TimetableChecker.zip
retention-days: 1
- uses: actions/upload-artifact@v1
with:
name: ttb_check_python_parser
path: CI-Development/scripts/ttb_check.py
retention-days: 1
run_timetable_check:
needs: prepare-checker
name: Run Timetable Checker
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python for Parsing Output
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Retrieve Timetable Checker Executable
uses: actions/download-artifact@v1
with:
name: ttb_checker_exe_archive
- name: Retrieve Timetable Check Output Parser
uses: actions/download-artifact@v1
with:
name: ttb_check_python_parser
- name: Unpack Executable from Archive
run: Expand-Archive -LiteralPath 'ttb_checker_exe_archive\TimetableChecker.zip' -D 'TimetableChecker'
shell: powershell
- name: Prepare Railway and Timetable Files for Checking
run: |
Copy-Item 'Program_Timetables\*.ttb' -destination '.'
Copy-Item 'Railway\*.rly' -destination '.'
Rename-Item -Path '*.ttb' -NewName 'test.ttb'
Rename-Item -Path '*.rly' -NewName 'test.rly'
Get-ChildItem -Path .
continue-on-error: true
- name: Check testfile exists
id: check_test
uses: andstor/file-existence-action@v1
with:
files: "test.ttb"
- name: Run Timetable Checker Executable
run: .\TimetableChecker\TimetableChecker\TimetableChecker.exe
if: ${{ steps.check_test.outputs.files_exists == 'true' }}
- name: Output the file
run: cat Output.txt
shell: powershell
if: ${{ steps.check_test.outputs.files_exists == 'true' }}
- uses: actions/upload-artifact@v1
with:
name: ttb_check_output_file
path: Output.txt
if-no-files-found: ignore
retention-days: 1
if: ${{ steps.check_test.outputs.files_exists == 'true' }}
- name: Parse Output File with Python
run: python ttb_check_python_parser/ttb_check.py Output.txt
if: ${{ steps.check_test.outputs.files_exists == 'true' }}