Deduplicate using action matrix
This commit is contained in:
82
.github/workflows/main.yml
vendored
82
.github/workflows/main.yml
vendored
@ -9,14 +9,14 @@ on:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
feedc0de:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: feedc0de
|
||||
strategy:
|
||||
matrix:
|
||||
node: [feedc0de, comred]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
#with:
|
||||
# submodules: recursive
|
||||
|
||||
- name: Get esp-idf checkout hash
|
||||
run: |
|
||||
@ -67,80 +67,12 @@ jobs:
|
||||
run: |
|
||||
export CCACHE_MAXSIZE=400M
|
||||
. export.sh
|
||||
./switchconf.sh feedc0de
|
||||
./switchconf.sh ${{ matrix.node }}
|
||||
idf.py --ccache build
|
||||
ccache -s
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
with:
|
||||
name: bobbyquad_feedc0de
|
||||
path: build_feedc0de/bobbyquad_feedc0de.bin
|
||||
|
||||
comred:
|
||||
runs-on: ubuntu-latest
|
||||
name: comred
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
#with:
|
||||
# submodules: recursive
|
||||
|
||||
- name: Get esp-idf checkout hash
|
||||
run: |
|
||||
ESP_IDF_HASH="$(git submodule | awk '{ if ($2 == "esp-idf") print $1 }')"
|
||||
echo "ESP_IDF_HASH=${ESP_IDF_HASH#"-"}" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache esp-idf
|
||||
id: cache-esp-idf
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
.git/modules/esp-idf
|
||||
esp-idf
|
||||
key: ${{ runner.os }}-esp-idf-${{ env.ESP_IDF_HASH }}
|
||||
|
||||
- name: Checkout esp-idf
|
||||
if: steps.cache-esp-idf.outputs.cache-hit != 'true'
|
||||
run: git submodule update --init --recursive esp-idf
|
||||
|
||||
- name: Checkout dependencies
|
||||
run: git submodule update --init --recursive $(git submodule | awk '{ if ($2 != "esp-idf") print $2 }')
|
||||
|
||||
- name: Get esp-idf release name
|
||||
run: echo "ESP_RELEASE=$(git -C esp-idf describe --tags $(git -C esp-idf rev-list --tags --max-count=1))" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache .espressif
|
||||
id: cache-espressif
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.espressif
|
||||
key: ${{ runner.os }}-espressif-${{ env.ESP_RELEASE }}
|
||||
|
||||
- name: Install .espressif dependencies
|
||||
if: steps.cache-espressif.outputs.cache-hit != 'true'
|
||||
run: ./esp-idf/install.sh
|
||||
|
||||
- name: Install ccache
|
||||
run: DEBIAN_FRONTEND=noninteractive sudo apt install -y ccache
|
||||
|
||||
- name: Cache ccache
|
||||
id: cache-ccache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{ runner.os }}-ccache
|
||||
|
||||
- name: Build firmware
|
||||
run: |
|
||||
export CCACHE_MAXSIZE=400M
|
||||
. export.sh
|
||||
./switchconf.sh comred
|
||||
idf.py --ccache build
|
||||
ccache -s
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
with:
|
||||
name: bobbyquad_comred
|
||||
path: build_comred/bobbyquad_comred.bin
|
||||
name: bobbyquad_${{ matrix.node }}
|
||||
path: build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.bin
|
||||
|
Reference in New Issue
Block a user