forked from DFHack/dfhack
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (91 loc) · 2.96 KB
/
test-suite.yml
File metadata and controls
93 lines (91 loc) · 2.96 KB
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
name: Test suite
on:
workflow_call:
inputs:
dfhack_repo:
type: string
dfhack_ref:
type: string
os:
type: string
compiler:
type: string
plugins:
type: string
config:
type: string
jobs:
run-tests:
name: Test (${{ inputs.os }}, ${{ inputs.compiler }}, ${{ inputs.plugins }} plugins, ${{ inputs.config }} config)
runs-on: ${{ inputs.os }}-latest
steps:
- name: Set env
shell: bash
run: echo "DF_FOLDER=DF" >>$GITHUB_ENV
- name: Install dependencies
if: inputs.os == 'ubuntu'
run: |
sudo apt-get update
sudo apt-get install \
libsdl2-2.0-0 \
libsdl2-image-2.0-0
- name: Clone DFHack
uses: actions/checkout@v4
with:
repository: ${{ inputs.dfhack_repo }}
ref: ${{ inputs.dfhack_ref }}
- name: Detect DF version
shell: bash
run: echo DF_VERSION="$(sh ci/get-df-version.sh)" >>$GITHUB_ENV
- name: Fetch DF cache
id: restore-df
uses: actions/cache/restore@v4
with:
path: ${{ env.DF_FOLDER }}
key: df-${{ inputs.os }}-${{ env.DF_VERSION }}-${{ hashFiles('ci/download-df.sh') }}
- name: Download DF
if: steps.restore-df.outputs.cache-hit != 'true'
run: sh ci/download-df.sh ${{ env.DF_FOLDER }} ${{ inputs.os }} ${{ env.DF_VERSION }}
- name: Save DF cache
if: steps.restore-df.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.DF_FOLDER }}
key: df-${{ inputs.os }}-${{ env.DF_VERSION }}-${{ hashFiles('ci/download-df.sh') }}
- name: Install blank DFHack init scripts
if: inputs.config == 'empty'
shell: bash
run: |
mkdir -p ${{ env.DF_FOLDER }}/dfhack-config/init
cd data/dfhack-config/init
for fname in *.init; do touch ../../../${{ env.DF_FOLDER }}/dfhack-config/init/$fname; done
- name: Download DFHack
uses: actions/download-artifact@v4
with:
name: test-${{ inputs.compiler }}
- name: Install DFHack
shell: bash
run: tar xjf test-${{ inputs.compiler }}.tar.bz2 -C ${{ env.DF_FOLDER }}
- name: Start X server
if: inputs.os == 'ubuntu'
run: Xvfb :0 -screen 0 1600x1200x24 &
- name: Run lua tests
uses: nick-fields/retry@v3
env:
DISPLAY: :0
TERM: xterm-256color
with:
timeout_minutes: 1
command: python ci/run-tests.py --keep-status "${{ env.DF_FOLDER }}"
- name: Check RPC interface
run: python ci/check-rpc.py "${{ env.DF_FOLDER }}/dfhack-rpc.txt"
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
continue-on-error: true
with:
name: test-output-${{ inputs.compiler }}-${{ inputs.plugins }}_plugins-${{ inputs.config }}_config
path: |
${{ env.DF_FOLDER }}/dfhack-rpc.txt
${{ env.DF_FOLDER }}/test*.json
${{ env.DF_FOLDER }}/*.log