mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-21 20:33:53 +08:00
* build docker image with scons cache * use setup * scons cache * added the dockerfile * add the shell * docs use cache * dont pull lfs for docs * simulator too * dont pull the cache image * fix inputs * inputs * booleans aren't supported * bool not supported * bool isnt supported * fix * readonly cache * fix sim cache too * respect readonly * gitignore and move to correct folder * also copy old * move to tools/ci * move to selfdrive/test * just make the cache writable, it's discarded anyway * minimize diff in this pr
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: 'openpilot env setup'
|
|
|
|
inputs:
|
|
setup_docker_scons_cache:
|
|
description: 'Whether or not to build the scons-cache docker image'
|
|
required: false
|
|
default: 'false'
|
|
git_lfs:
|
|
description: 'Whether or not to pull the git lfs'
|
|
required: false
|
|
default: 'true'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
# do this after checkout to ensure our custom LFS config is used to pull from GitLab
|
|
- shell: bash
|
|
if: ${{ inputs.git_lfs == 'true' }}
|
|
run: git lfs pull
|
|
|
|
# build cache
|
|
- id: date
|
|
shell: bash
|
|
run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
|
|
- shell: bash
|
|
run: echo "$CACHE_COMMIT_DATE"
|
|
- id: restore-scons-cache
|
|
uses: actions/cache/restore@v3
|
|
with:
|
|
path: ~/scons_cache
|
|
key: scons-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
|
restore-keys: |
|
|
scons-${{ env.CACHE_COMMIT_DATE }}-
|
|
scons-
|
|
- id: setup-scons-cache-docker
|
|
name: Sets up a docker image with scons cache that can by mounted as a buildkit cache mount
|
|
shell: bash
|
|
if: ${{ inputs.setup_docker_scons_cache == 'true' }}
|
|
run: |
|
|
cp selfdrive/test/Dockerfile.scons_cache ~
|
|
cd ~
|
|
DOCKER_BUILDKIT=1 docker build -t scons-cache -f Dockerfile.scons_cache .
|
|
# build our docker image
|
|
- shell: bash
|
|
run: eval ${{ env.BUILD }}
|