From dd1609a9d123e0d09415721a47bd82f40ed2ff43 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 27 Oct 2022 18:02:23 +0300 Subject: [PATCH] ci: try to pio-run too include caching of libraries test github actions syntax magic as well --- .github/workflows/push.yml | 24 ++++++++++++++++++++---- ci_script.sh | 4 ++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5ac330a7..9c32b002 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - env: [esp8266-4m-base, esp8266-4m-latest-base] + env: [nodemcu-lolin, esp8266-4m-base, esp8266-4m-latest-base] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -63,10 +63,26 @@ jobs: uses: actions/cache@v2 with: path: ~/.platformio - key: ${{ runner.os }}-${{ matrix.env }}-${{ hashFiles('code/platformio.ini') }} + key: ${{ runner.os }}-build-${{ matrix.env }}-${{ hashFiles('code/platformio.ini') }} + restore-keys: | + ${{ runner.os }}-build-${{ matrix.env }}- + ${{ runner.os }}-build- + - name: Cache libraries + uses: actions/cache@v2 + with: + path: libraries/ + key: ${{ runner.os }}-libraries-${{ hashFiles('code/platformio.ini') }} + restore-keys: | + ${{ runner.os }}-libraries- - name: PlatformIO prepare run: | git config --global advice.detachedHead false - ./ci_install.sh build - - run: | + ./ci_install.sh build ${{ matrix.env }} + - if: ${{ matrix.env }} == 'nodemcu-lolin' + name: Basic build + run: | ./ci_script.sh build ${{ matrix.env }} + - if: ${{ matrix.env }} != 'nodemcu-lolin' + name: Test build + run: | + ./ci_script.sh test ${{ matrix.env }} diff --git a/ci_script.sh b/ci_script.sh index 1a5fc058..71e70d40 100755 --- a/ci_script.sh +++ b/ci_script.sh @@ -28,6 +28,10 @@ case "$1" in git --no-pager diff --stat ;; ("build") + # simply build the given environment + pio run -e $2 + ;; +("test") # run generic build test with the specified environment as base scripts/test_build.py -e $2 ;;