-
Notifications
You must be signed in to change notification settings - Fork 11
91 lines (83 loc) · 2.57 KB
/
ci.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
name: CI
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
schedule:
- cron: "0 5 * * 1"
permissions:
contents: read
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
TEST_RELEASE_SUMMARY: |-
Test "release" summary
* Multiple lines
jobs:
build:
name: Build test configuration for esphome:${{ matrix.esphome-version }} with ${{ matrix.manifest }} manifest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
esphome-version:
- stable
- beta
- dev
manifest:
- complete
- partial
steps:
- name: Checkout
uses: actions/[email protected]
- name: Run action
uses: ./
id: esphome-build
with:
yaml-file: tests/test.yaml
version: ${{ matrix.esphome-version }}
platform: linux/amd64
cache: true
release-summary: ${{ env.TEST_RELEASE_SUMMARY }}
release-url: "https://github.com/esphome/build-action"
complete-manifest: ${{ matrix.manifest == 'complete' }}
- name: Write version to file
run: echo ${{ steps.esphome-build.outputs.version }} > ${{ steps.esphome-build.outputs.name }}/version
- name: Upload ESPHome binary
uses: actions/[email protected]
with:
name: build-output-files-${{ matrix.esphome-version }}-${{ matrix.manifest }}
path: ${{ steps.esphome-build.outputs.name }}
verify:
name: Verify output files for esphome:${{ matrix.esphome-version }} with ${{ matrix.manifest }} manifest
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
esphome-version:
- stable
- beta
- dev
manifest:
- complete
- partial
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download files
uses: actions/[email protected]
with:
name: build-output-files-${{ matrix.esphome-version }}-${{ matrix.manifest }}
- name: List files
run: |-
ls -al
tree
- name: Validate json file matches ${{ matrix.manifest }} manifest-template.json
run: |
jq -n --arg md5 "$(md5sum test-esp32.ota.bin | head -c 32)" -f tests/${{ matrix.manifest }}-manifest-template.json > /tmp/manifest.json
diff <(jq --sort-keys . /tmp/manifest.json) <(jq --sort-keys . manifest.json)