-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (77 loc) · 2.23 KB
/
test_ufbt.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
name: Testsuite
on:
workflow_call:
inputs:
ufbt-version:
description: 'ufbt version to use'
type: string
required: false
default: 'latest'
sdk-channel:
description: 'Release channel to use'
type: string
required: false
default: ''
sdk-file:
description: 'Path to SDK archive'
type: string
required: false
default: ''
jobs:
test-ufbt-action:
runs-on: ubuntu-latest
name: Test action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ufbt
uses: ./ # Uses an action in the root directory
with:
ufbt-version: ${{ inputs.ufbt-version }}
sdk-channel: ${{ inputs.sdk-channel }}
sdk-file: ${{ inputs.sdk-file }}
task: setup
- name: Create app
id: create-app
shell: bash
run: |
mkdir test
cd test
ufbt create APPID=test
- name: Build test app
uses: ./
id: build-app
with:
skip-setup: true
app-dir: 'test'
- name: Upload app artifacts
uses: actions/upload-artifact@v4
with:
name: fap-${{ steps.build-app.outputs.suffix }}
path: ${{ steps.build-app.outputs.fap-artifacts }}
- name: Break app
id: break-app
shell: bash
run: |
echo "static int testmain(int unused_i) { return 1; }" >> test/test.c
- name: Lint broken app
uses: ./
id: lint-broken-app
continue-on-error: true
with:
skip-setup: true
app-dir: 'test'
task: 'lint'
- name: Build broken app
uses: ./
id: build-broken-app
continue-on-error: true
with:
skip-setup: true
app-dir: 'test'
- name: Fail if lint or build of broken app succeeded
if: steps.lint-broken-app.outcome == 'success' || steps.build-broken-app.outcome == 'success'
run: exit 1
- name: Fail if lint or build of broken app did not produce error output
if: steps.lint-broken-app.outputs.lint-messages == '' || steps.build-broken-app.outputs.build-errors == ''
run: exit 1