-
Notifications
You must be signed in to change notification settings - Fork 2
149 lines (142 loc) · 6.01 KB
/
Copy pathmain.yml
File metadata and controls
149 lines (142 loc) · 6.01 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Main
on:
push:
workflow_dispatch:
inputs:
verbose:
description: 'Verbose'
default: 'no'
jobs:
blackbox-tests:
name: Blackbox Tests
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/version-')
runs-on: ubuntu-latest
container:
image: qtoggle/espqtoggle-builder
defaults:
run:
shell: bash
timeout-minutes: 1800
env:
TESTMYESP_SERVER: http://testmyesp.qtoggle.io:9999
TEST_JWT_ADMIN_EMPTY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxVG9nZ2xlIiwidXNyIjoiYWRtaW4iLCJvcmkiOiJjb25zdW1lciJ9.H3TvAcQmDhSel5igbz_kfD_hExMfLJeRA5_aDZ1rOEY
TEST_JWT_ADMIN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxVG9nZ2xlIiwidXNyIjoiYWRtaW4iLCJvcmkiOiJjb25zdW1lciJ9.G5sk6HuwGnN78yszwiDqz_CpL86GVXVooIqyVBxD55g
TEST_JWT_NORMAL: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxVG9nZ2xlIiwidXNyIjoibm9ybWFsIiwib3JpIjoiY29uc3VtZXIifQ.NZ47Ds0o6rRLoxmf7BUaMoP02bg-5gbk6iGwz7Is1L4
TEST_JWT_VIEWONLY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxVG9nZ2xlIiwidXNyIjoidmlld29ubHkiLCJvcmkiOiJjb25zdW1lciJ9.w4rypmwbDYtdvoG544-_I7Vcw4n6KaUNNlfH5aUTHaw
TEST_JWT_WEBHOOKS: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJxVG9nZ2xlIiwib3JpIjoiZGV2aWNlIn0.rExjwcHPY77Hi5pi0zIDqiL3dK-3BesrH2SDVdRMySE
TEST_SSID: testmyesp
TEST_PSK: test1234
TEST_PASSWORD: test_password
TEST_NETWORK_DEVICE_IP: 10.10.10.15
TEST_NETWORK_HOST_IP: 10.10.10.1
TEST_NETWORK_START_IP: 10.10.10.10
TEST_NETWORK_STOP_IP: 10.10.10.20
TEST_NETWORK_MASK: 16
JOB_TIMEOUT: 900
steps:
- name: Source code checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build
run: |
make clean
make -j4
- name: TestMyESP helper
run: |
export VERSION=0.0.0-unknown.0
extra_opts=""
if [[ "${{ github.event.inputs.verbose }}" == "yes" ]]; then
extra_opts+="--verbose"
fi
./test/testmyesp-helper.sh \
--server-url ${TESTMYESP_SERVER} \
--credentials ${{ secrets.TESTMYESP_USERNAME }}:${{ secrets.TESTMYESP_PASSWORD }} \
--show-serial-log \
--timeout ${JOB_TIMEOUT} \
--flash-image-fill null.bin 0xFC000 0 16384 \
--flash-image-url esp_init_data_default.bin 0xFC000 https://github.com/espressif/ESP8266_NONOS_SDK/raw/v2.2.1/bin/esp_init_data_default_v08.bin \
--flash-image-url sysparam.bin 0xFE000 https://github.com/espressif/ESP8266_NONOS_SDK/raw/v2.2.1/bin/blank.bin \
--flash-image-url boot.bin 0x00000 https://github.com/espressif/ESP8266_NONOS_SDK/raw/v2.2.1/bin/boot_v1.7.bin \
--flash-image-file user1.bin 0x01000 build/user1.bin \
--flash-image-file user2.bin 0x81000 build/user2.bin \
--flash-image-fill config.bin 0x7C000 0 16384 \
--test-cases test/test-cases/01-wifi/*.json \
--test-cases test/test-cases/02-api/*/*.json \
--test-cases test/test-cases/03-sleep-mode/*.json \
--test-cases test/test-cases/04-setup-mode/*.json \
--test-cases test/test-cases/05-provisioning/*.json \
--test-cases test/test-cases/06-gpiop/*.json \
--test-cases test/test-cases/07-adcp/*.json ${extra_opts}
release-s3:
name: Release To S3
if: startsWith(github.ref, 'refs/tags/version-')
needs:
- blackbox-tests
runs-on: ubuntu-latest
container:
image: qtoggle/espqtoggle-builder
defaults:
run:
shell: bash
env:
S3_BUCKET: qtoggle
S3_FOLDER: firmware/espqtoggle
steps:
- name: Source code checkout
uses: actions/checkout@master
- name: Extract version from tag
id: tagName
uses: olegtarasov/get-tag@v2.1
with:
tagRegex: "version-(?<version>.*)"
- name: Build
run: |
export DEBUG=false
export VERSION="${{ steps.tagName.outputs.version }}"
make clean
make -j4
- name: Setup s3cmd
run: |
echo "[default]" > ~/.s3cfg
echo "access_key = ${{ secrets.AWS_ACCESS_KEY }}" >> ~/.s3cfg
echo "secret_key = ${{ secrets.AWS_SECRET_KEY }}" >> ~/.s3cfg
- name: Upload to S3
run: |
VERSION="${{ steps.tagName.outputs.version }}"
if [[ "${VERSION}" =~ beta.[0-9]+$ ]]; then # beta version
latest_file="latest_beta"
elif [[ "${VERSION}" =~ alpha.[0-9]+$ ]]; then # alpha version
latest_file="latest_alpha"
else # stable version
latest_file="latest_stable"
fi
echo "Version: ${VERSION}" > build/${latest_file}
echo -n "Date: " >> build/${latest_file}
date "+%Y-%m-%d" >> build/${latest_file}
s3cmd put -P --guess-mime-type build/user*.bin s3://${S3_BUCKET}/${S3_FOLDER}/${VERSION}/
s3cmd put -P --guess-mime-type build/firmware.bin s3://${S3_BUCKET}/${S3_FOLDER}/${VERSION}/
s3cmd put -P --guess-mime-type build/${latest_file} s3://${S3_BUCKET}/${S3_FOLDER}/${latest_file}
s3cmd put -P --guess-mime-type build/${latest_file} s3://${S3_BUCKET}/${S3_FOLDER}/latest
release-gh:
name: Release To Github
if: startsWith(github.ref, 'refs/tags/version-')
needs:
- release-s3
runs-on: ubuntu-latest
steps:
- name: Extract version from tag
id: tagName
uses: olegtarasov/get-tag@v2.1
with:
tagRegex: "version-(?<version>.*)"
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.tagName.outputs.version }}
draft: true
prerelease: contains(github.ref, 'alpha') || contains(github.ref, 'beta')
body: |
What's new (since ...):
- ...
Download [firmware.bin](https://provisioning.qtoggle.io/firmware/espqtoggle/${{ steps.tagName.outputs.version }}/firmware.bin).