Skip to content

Refactor action code + add CI to make sure it does the job correctly #32

Refactor action code + add CI to make sure it does the job correctly

Refactor action code + add CI to make sure it does the job correctly #32

Workflow file for this run

name: CI
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
schedule:
- cron: "0 5 * * 1"
jobs:
build:
name: Build test configuration for esphome:${{ matrix.esphome-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
esphome-version:
- stable
# - beta
# - dev
steps:
- name: Checkout
uses: actions/[email protected]
- name: Run action
uses: ./
id: esphome-build
with:
yaml_file: .github/workflows/test_files/test.yaml
version: ${{ matrix.esphome-version }}
platform: linux/amd64
cache: true
release_summary: "Test release summary"
release_url: "https://github.com/esphome/build-action"
- 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 }}
path: ${{ steps.esphome-build.outputs.name }}
verify:
name: Verify output files for esphome:${{ matrix.esphome-version }}
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
esphome-version:
- stable
# - beta
# - dev
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download files
uses: actions/[email protected]
with:
name: build-output-files-${{ matrix.esphome-version }}
- name: List files
run: |-
ls -al
tree
- name: Validate json file matches manifest-template.json
run: |
jq -n --arg md5 "$(md5sum test-esp32.ota.bin | head -c 32)" -f .github/workflows/test_files/manifest-template.json > /tmp/manifest.json
diff <(jq --sort-keys . /tmp/manifest.json) <(jq --sort-keys . manifest.json)