From b3cd10eff5dbcff1a054a30fa282f4ff5956e7b7 Mon Sep 17 00:00:00 2001 From: Daniel Brunner Date: Sun, 19 Sep 2021 00:04:39 +0200 Subject: [PATCH] Add action.yml --- action.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..059f434 --- /dev/null +++ b/action.yml @@ -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