mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
93
.github/workflows/selfdrive_tests.yaml
vendored
93
.github/workflows/selfdrive_tests.yaml
vendored
@@ -89,99 +89,6 @@ jobs:
|
||||
with:
|
||||
cache_key_prefix: scons_${{ matrix.arch }}
|
||||
|
||||
build_mac:
|
||||
name: build macos
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- run: git lfs pull
|
||||
- name: Determine pre-existing Homebrew packages
|
||||
if: steps.dependency-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
echo 'EXISTING_CELLAR<<EOF' >> $GITHUB_ENV
|
||||
brew list --formula -1 >> $GITHUB_ENV
|
||||
echo 'EOF' >> $GITHUB_ENV
|
||||
- name: Restore scons cache
|
||||
id: scons-restore-cache
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: /tmp/scons_cache
|
||||
key: macos_scons-${{ github.sha }}
|
||||
restore-keys: macos_scons-
|
||||
- name: Cache dependencies
|
||||
id: dependency-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
.env
|
||||
.venv
|
||||
~/github_brew_cache_entries.txt
|
||||
~/.pyenv
|
||||
~/Library/Caches/pypoetry
|
||||
/usr/local/Cellar
|
||||
/usr/local/opt
|
||||
/usr/local/Caskroom/gcc-arm-*
|
||||
/opt/homebrew/Cellar
|
||||
/opt/homebrew/opt
|
||||
/opt/homebrew/Caskroom/gcc-arm-*
|
||||
/Applications/ArmGNUToolchain/*/*/*
|
||||
key: macos_deps-${{ hashFiles('tools/mac_setup.sh', 'tools/install_python_dependencies.sh', 'poetry.lock') }}
|
||||
restore-keys: macos_deps-
|
||||
- name: Brew link restored dependencies
|
||||
run: |
|
||||
if [ -f ~/github_brew_cache_entries.txt ]; then
|
||||
brew link --force --overwrite $(cat ~/github_brew_cache_entries.txt) # `--force` for keg-only packages
|
||||
if [ -d /Applications/ArmGNUToolchain ]; then # link gcc-arm-embedded manually
|
||||
GCC_TOOLCHAIN="$(echo /Applications/ArmGNUToolchain/**/**/bin)"
|
||||
echo "$GCC_TOOLCHAIN" >> $GITHUB_PATH
|
||||
fi
|
||||
else
|
||||
echo "Cache entries not found"
|
||||
fi
|
||||
- name: Install dependencies
|
||||
if: steps.dependency-cache.outputs.cache-hit != 'true'
|
||||
run: SKIP_PROMPT=1 ./tools/mac_setup.sh
|
||||
env:
|
||||
# package install has DeprecationWarnings
|
||||
PYTHONWARNINGS: default
|
||||
- name: Build openpilot
|
||||
run: |
|
||||
eval "$(pyenv init --path)"
|
||||
poetry run scons -j$(nproc)
|
||||
- name: Run tests
|
||||
run: |
|
||||
eval "$(pyenv init --path)"
|
||||
poetry run tools/plotjuggler/test_plotjuggler.py
|
||||
- name: Pre Cache - Cleanup scons cache
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
rm -rf /tmp/scons_cache/*
|
||||
eval "$(pyenv init --path)"
|
||||
poetry run scons -j$(nproc) --cache-populate
|
||||
- name: Save scons cache
|
||||
id: scons-save-cache
|
||||
uses: actions/cache/save@v3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
with:
|
||||
path: /tmp/scons_cache
|
||||
key: macos_scons-${{ github.sha }}
|
||||
- name: Pre Cache - Remove pre-existing Homebrew packages
|
||||
if: steps.dependency-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
new_cellar=$(brew list --formula -1)
|
||||
exceptions="zstd lz4 xz" # caching step needs zstd
|
||||
comm -12 <(echo "$EXISTING_CELLAR") <(echo "$new_cellar") | while read pkg; do
|
||||
if [[ " $exceptions " != *" $pkg "* ]]; then
|
||||
rm -rf "$(brew --cellar)/$pkg"
|
||||
fi
|
||||
done
|
||||
comm -13 <(echo "$EXISTING_CELLAR") <(echo "$new_cellar") | tee ~/github_brew_cache_entries.txt
|
||||
# .fseventsd directory causes permission errors in dep caching step
|
||||
# its used by the system to observe changes within the directory - toolchain works without it, just remove it
|
||||
sudo rm -rf /Applications/ArmGNUToolchain/*/*/.fseventsd
|
||||
|
||||
docker_push:
|
||||
name: docker push
|
||||
strategy:
|
||||
|
||||
Reference in New Issue
Block a user