forked from CausticCove/CC
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (71 loc) · 2.85 KB
/
Copy pathrun_integration_tests.yml
File metadata and controls
78 lines (71 loc) · 2.85 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
# This is a reusable workflow to run integration tests on a single map.
# This is run for every single map in ci_suite.yml. You might want to edit that instead.
name: Run Integration Tests
on:
workflow_call:
inputs:
map:
required: true
type: string
major:
required: false
type: string
minor:
required: false
type: string
max_required_byond_client:
required: true
type: string
jobs:
run_integration_tests:
# If `inputs.major` is specified, this will output `Run Tests (major.minor; map; max)`.
# For example, `Run Tests (515.1627; runtimestation; 515)`.
#
# Otherwise, it will output `Run Tests (map; max)`.
# For example, `Run Tests (runtimestation; 515)`.
name: Run Tests (${{ inputs.major && format('{0}.{1}; ', inputs.major, inputs.minor) || '' }}${{ inputs.map }}; ${{ inputs.max_required_byond_client }})
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
with:
major: ${{ inputs.major }}
minor: ${{ inputs.minor }}
- name: Download build outputs
uses: actions/download-artifact@v4
with:
name: build-artifact-${{ inputs.major || env.BYOND_MAJOR }}-${{ inputs.minor || env.BYOND_MINOR}}
path: ./
- name: Install rust-g
run: |
bash tools/ci/install_rust_g.sh
- name: Install BYOND dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev:i386
- name: Run Tests
id: run_tests
run: |
source $HOME/BYOND/byond/bin/byondsetup
bash tools/ci/run_server.sh ${{ inputs.map }}
# - name: On test fail, write a step summary
# if: always() && steps.run_tests.outcome == 'failure'
# run: |
# # Get a JSON array of failed unit tests
# FAILED_UNIT_TESTS=$(jq 'to_entries | map(.value | select(.status == 1))' data/unit_tests.json)
# FAIL_COUNT=$(echo $FAILED_UNIT_TESTS | jq 'length')
# echo "# Test failures" >> $GITHUB_STEP_SUMMARY
# echo "$FAIL_COUNT tests failed." >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# for i in $( seq $FAIL_COUNT ); do
# CURRENT_FAIL=$(echo $FAILED_UNIT_TESTS | jq --arg i $i '.[($i | tonumber) - 1]')
# TEST=$(echo $CURRENT_FAIL | jq --raw-output '.name')
# echo "### $TEST" >> $GITHUB_STEP_SUMMARY
# echo '```' >> $GITHUB_STEP_SUMMARY
# echo $CURRENT_FAIL | jq --raw-output '.message' >> $GITHUB_STEP_SUMMARY
# echo '```' >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# done