-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (78 loc) · 2.54 KB
/
unit-tests.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
# credit goes to MikeSchulze for creating the workflow this is based on
# https://github.com/MikeSchulze/gdUnit4/blob/master/.github/workflows/unit-tests.yml
name: unit-tests
run-name: ${{ github.head_ref || github.ref_name }}-unit-tests
on:
workflow_call:
inputs:
os:
required: false
type: string
default: 'ubuntu-22.04'
godot-version:
required: true
type: string
godot-status:
required: true
type: string
workflow_dispatch:
inputs:
os:
required: false
type: string
default: 'ubuntu-22.04'
godot-version:
required: true
type: string
godot-status:
required: true
type: string
concurrency:
group: unit-tests-${{ github.head_ref || github.ref_name }}-${{ inputs.godot-version }}
cancel-in-progress: true
jobs:
unit-test:
name: "Unit Tests"
runs-on: ${{ inputs.os }}
timeout-minutes: 15
steps:
- name: "Checkout GdUnit Repository"
uses: actions/checkout@v3
with:
lfs: true
submodules: 'recursive'
- name: "Install Godot ${{ inputs.godot-version }}"
uses: ./.github/actions/godot-install
with:
godot-version: ${{ inputs.godot-version }}
godot-status-version: ${{ inputs.godot-status }}
godot-bin-name: 'linux.x86_64'
godot-cache-path: '~/godot-linux'
- name: "Update Project"
if: ${{ !cancelled() }}
timeout-minutes: 1
continue-on-error: true # we still ignore the timeout, the script is not quit and we run into a timeout
shell: bash
run: |
xvfb-run --auto-servernum ~/godot-linux/godot -e --path . -s res://addons/gdUnit4/bin/ProjectScanner.gd --headless --audio-driver Dummy
- name: "Run Unit Tests"
if: ${{ !cancelled() }}
timeout-minutes: 8
uses: ./.github/actions/unit-test
with:
godot-bin: '~/godot-linux/godot'
test-includes: "res://test/"
- name: "Set Report Name"
if: ${{ always() }}
shell: bash
run: echo "REPORT_NAME=${{ inputs.os }}-${{ inputs.godot-version }}" >> "$GITHUB_ENV"
- name: "Publish Unit Test Reports"
if: ${{ !cancelled() }}
uses: ./.github/actions/publish-test-report
with:
report-name: ${{ env.REPORT_NAME }}
- name: "Upload Unit Test Reports"
if: ${{ !cancelled() }}
uses: ./.github/actions/upload-test-report
with:
report-name: ${{ env.REPORT_NAME }}