Add action.yml

This commit is contained in:
2021-09-19 00:04:39 +02:00
committed by GitHub
parent 97456b066d
commit b3cd10eff5

36
action.yml Normal file
View File

@@ -0,0 +1,36 @@
name: Install esp-idf
description: Installs or updates esp-idf dependencies (and caches them)
inputs:
idfpath:
description: Path to esp-idf (should be a submodule of the firmware repository)
required: true
default: esp-idf
outputs: {}
runs:
using: composite
steps:
- name: Get esp-idf release name
id: get-esp-idf-release
uses: 0xFEEDC0DE64/get_latest_tag@main
with:
repo: ${{ inputs.idfpath }}
- name: Cache .espressif
id: cache-espressif
uses: actions/cache@v2
with:
path: ~/.espressif
key: ${{ runner.os }}-${{ steps.get-esp-idf-release.outputs.tag_name }}
- name: Install .espressif dependencies
# GitHub doesnt support if
#if: steps.cache-espressif.outputs.cache-hit != 'true'
#run: $(realpath -s "${{ inputs.idfpath }}")/install.sh
run: |
if echo ${{ steps.cache-espressif.outputs.cache-hit }} | grep -c "true"
then
echo "Cache hit - skipping esp-idf install"
else
$(realpath -s "${{ inputs.idfpath }}")/install.sh
fi
shell: bash