-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (111 loc) · 3.62 KB
/
build.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Plugin build
on:
push:
branches: [main]
pull_request:
branches: '*'
jobs:
build-native:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019] # windows-latest does not have visual studio 2017
otp: ['24.0']
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
- uses: wagoid/commitlint-github-action@v4
if: matrix.os == 'ubuntu-20.04'
- uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
#=========================================
# Test dependencies (ubuntu)
#=========================================
# TODO cache
- name: Install test dependencies (ubuntu)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" && sudo apt update && sudo apt install -y clang-tidy-14
# Add llvm-14 binaries into the path early on
echo "/usr/lib/llvm-14/bin" >> $GITHUB_PATH
#=========================================
# Build script python dependencies
#=========================================
- name: Cache Pip
uses: actions/cache@v3
with:
path: |
~\AppData\Local\pip\Cache
~/.cache/pip
key: cache-pip-${{ matrix.os }}-${{ hashFiles('bin/requirements.txt') }}
restore-keys: |
cache-pip-${{ matrix.os }}-
- name: Install requirements
run: |
python3 -m pip install -r bin/requirements.txt
#=========================================
# Build AWS IoT Device SDK
#=========================================
- name: Restore SDK Cache
id: cache-sdk-restore
uses: actions/cache/restore@v3
with:
path: |
_build_sdk
key: cache-sdk-1-${{ matrix.os }}
- name: Build SDK
if: steps.cache-sdk-restore.outputs.cache-hit != 'true'
run: |
python3 -u -m bin --sdk-only
- name: Save SDK Cache
id: cache-sdk-save
uses: actions/cache/save@v3
with:
path: |
_build_sdk
key: ${{ steps.cache-sdk-restore.outputs.cache-primary-key }}
#=========================================
# Build EMQX
#=========================================
- name: Restore EMQX Cache
id: cache-emqx-restore
uses: actions/cache/restore@v3
with:
path: |
emqx
# TODO use commit as cache key
key: cache-emqx-5.1.2-${{ matrix.os }}
- name: Build EMQX
if: steps.cache-emqx-restore.outputs.cache-hit != 'true'
run: |
python3 -u -m bin --emqx-only
- name: Save EMQX Cache
id: cache-emqx-save
uses: actions/cache/save@v3
with:
path: |
emqx
key: ${{ steps.cache-emqx-restore.outputs.cache-primary-key }}
#=========================================
# Build Port Driver and Plugin
#=========================================
- name: Build
run: |
python3 -u -m bin --port-driver-only
python3 -u -m bin --quick
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: Build artifact ${{matrix.os}}
path: build/emqx.zip