-
Notifications
You must be signed in to change notification settings - Fork 34
112 lines (110 loc) · 3.53 KB
/
build-and-target-test.yml
File metadata and controls
112 lines (110 loc) · 3.53 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build and Test
on:
workflow_dispatch:
inputs:
build_all:
description: Build all board configurations
type: boolean
required: true
default: false
device_thingy91x:
description: 'Test thingy91x'
type: boolean
required: false
default: true
device_nrf9151dk:
description: 'Test nrf9151dk'
type: boolean
required: false
default: false
device_ppk_thingy91x:
description: 'Test ppk_thingy91x'
type: boolean
required: false
default: false
device_gnss_nrf9151dk:
description: 'Test gnss_nrf9151dk'
type: boolean
required: false
default: false
device_prov_thingy91x:
description: 'Test prov_thingy91x'
type: boolean
required: false
default: false
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
paths-ignore:
- "docs/**"
jobs:
setup:
runs-on: ubuntu-latest
outputs:
devices: ${{ steps.setup.outputs.devices }}
build_all: ${{ steps.setup.outputs.build_all == 'true' }}
push_memory_badges: ${{ steps.setup.outputs.push_memory_badges == 'true' }}
steps:
- name: Setup
id: setup
run: |
SCHEDULED=${{ github.event_name == 'schedule' }}
PUSH=${{ github.event_name == 'push' }}
push_memory_badges=false
if [[ $SCHEDULED == true ]]; then
devices="thingy91x nrf9151dk ppk_thingy91x gnss_nrf9151dk prov_thingy91x"
build_all=true
push_memory_badges=true
elif [[ $PUSH == true ]]; then
devices="thingy91x"
build_all=false
else
# Build devices list from selected checkboxes
devices=""
if [[ "${{ inputs.device_thingy91x }}" == "true" ]]; then
devices="$devices thingy91x"
fi
if [[ "${{ inputs.device_nrf9151dk }}" == "true" ]]; then
devices="$devices nrf9151dk"
fi
if [[ "${{ inputs.device_ppk_thingy91x }}" == "true" ]]; then
devices="$devices ppk_thingy91x"
fi
if [[ "${{ inputs.device_gnss_nrf9151dk }}" == "true" ]]; then
devices="$devices gnss_nrf9151dk"
fi
if [[ "${{ inputs.device_prov_thingy91x }}" == "true" ]]; then
devices="$devices prov_thingy91x"
fi
# Trim leading space
devices=$(echo "$devices" | xargs)
build_all=${{ inputs.build_all }}
fi
echo "devices=$devices"
echo "build_all=$build_all"
echo "push_memory_badges=$push_memory_badges"
echo "devices=$devices" >> $GITHUB_OUTPUT
echo "build_all=$build_all" >> $GITHUB_OUTPUT
echo "push_memory_badges=$push_memory_badges" >> $GITHUB_OUTPUT
build:
needs: setup
uses: ./.github/workflows/build.yml
secrets: inherit
with:
build_all: ${{ needs.setup.outputs.build_all == 'true' }}
push_memory_badges: ${{ needs.setup.outputs.push_memory_badges == 'true' }}
test:
permissions:
actions: read
contents: write
packages: read
uses: ./.github/workflows/target-test.yml
needs: [build, setup]
secrets: inherit
with:
artifact_fw_version: ${{ needs.build.outputs.version }}
artifact_run_id: ${{ needs.build.outputs.run_id }}
devices: ${{ needs.setup.outputs.devices }}
test_all: ${{ needs.setup.outputs.build_all == 'true' }}