Actions: Add caching for MacOS and Windows build workflows (#11194)
This commit is contained in:
@@ -20,24 +20,45 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install deps
|
||||
- name: Capture runner image version (for caching)
|
||||
id: r_image
|
||||
run: echo "ver=$ImageVersion" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache Homebrew downloads
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/Library/Caches/Homebrew
|
||||
key: brew-macos-${{ inputs.macos_ver }}-${{ steps.r_image.outputs.ver }}
|
||||
|
||||
- name: Install deps (Homebrew)
|
||||
shell: bash
|
||||
run: |
|
||||
brew update
|
||||
brew install platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config ulfius
|
||||
env:
|
||||
# GitHub-Hosted MacOS runner images are updated frequently
|
||||
# so skip running `brew update` to avoid unnecessary failures and delays.
|
||||
HOMEBREW_NO_AUTO_UPDATE: "1"
|
||||
HOMEBREW_NO_INSTALL_CLEANUP: "1"
|
||||
run: >
|
||||
brew install
|
||||
platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config ulfius jsoncpp
|
||||
|
||||
- name: Get release version string
|
||||
run: |
|
||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||
id: version
|
||||
|
||||
- name: Cache PlatformIO packages
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.platformio/.cache
|
||||
key: pio-macos-${{ inputs.macos_ver }}-${{ hashFiles('platformio.ini', 'variants/native/portduino.ini') }}
|
||||
restore-keys: |
|
||||
pio-macos-${{ inputs.macos_ver }}-
|
||||
|
||||
- name: Build for MacOS
|
||||
run: |
|
||||
platformio run -e native-macos
|
||||
env:
|
||||
PKG_VERSION: ${{ steps.version.outputs.long }}
|
||||
# Errors in this step should not fail the entire workflow while MacOS support is in development.
|
||||
continue-on-error: true
|
||||
|
||||
- name: List output files
|
||||
run: ls -lah .pio/build/native-macos/
|
||||
|
||||
@@ -33,6 +33,7 @@ jobs:
|
||||
with:
|
||||
msystem: UCRT64
|
||||
update: true
|
||||
cache: true
|
||||
# argp is not packaged for the mingw environments and is built below.
|
||||
# Python is omitted too: MSYS2's reports a `mingw` platform tag no wheel matches.
|
||||
install: >-
|
||||
@@ -51,6 +52,7 @@ jobs:
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.14"
|
||||
cache: pip
|
||||
|
||||
# framework-portduino calls argp_parse(); MSYS2 packages argp only for the
|
||||
# msys runtime, which cannot link into a native binary. No install() rules.
|
||||
@@ -69,6 +71,14 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
pip install platformio
|
||||
|
||||
- name: Cache PlatformIO packages
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.platformio/.cache
|
||||
key: pio-windows-${{ inputs.windows_ver }}-${{ hashFiles('platformio.ini', 'variants/native/portduino.ini') }}
|
||||
restore-keys: |
|
||||
pio-windows-${{ inputs.windows_ver }}-
|
||||
|
||||
- name: Get release version string
|
||||
shell: pwsh
|
||||
id: version
|
||||
|
||||
Reference in New Issue
Block a user