forked from ExpressLRS/ExpressLRS
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (94 loc) · 2.96 KB
/
build.yml
File metadata and controls
111 lines (94 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build ExpressLRS
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.target }}
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio
- name: Run PlatformIO Tests
run: |
platformio platform install native
platformio platform update
cd src
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400" pio test -e native
targets:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.set-targets.outputs.targets }}
steps:
- name: Checkout
uses: actions/checkout@v2
- id: set-targets
run: echo "::set-output name=targets::[$(grep -r "\[env:" src/targets | sed 's/.*://' | sed s/.$// | egrep "(STLINK|UART)" | grep -v DEPRECATED | tr '\n' ',' | sed 's/,$/"\n/' | sed 's/,/","/'g | sed 's/^/"/')]"
build:
needs: targets
strategy:
fail-fast: false
matrix:
target: ${{fromJSON(needs.targets.outputs.targets)}}
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.target }}
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio
- name: Run PlatformIO
run: |
platformio platform update
platformio platform install native
mkdir -p ~/artifacts
cd src
case ${{matrix.target}} in
*2400* | FM30*)
export REG=-DRegulatory_Domain_ISM_2400
;;
*)
export REG=-DRegulatory_Domain_AU_915
;;
esac
# All the features
PLATFORMIO_BUILD_FLAGS="$REG -DUSE_DIVERSITY" pio run -e ${{ matrix.target }}
# Minimal/default features
PLATFORMIO_BUILD_FLAGS="$REG !-DUSE_DIVERSITY" pio run -e ${{ matrix.target }}
mv .pio/build ~/artifacts/AU_915
- name: Store Artifacts
uses: actions/upload-artifact@v2-preview
with:
name: ExpressLRS-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.run_number }}
path: ~/artifacts/**/*.bin
continue-on-error: true