mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 22:23:56 +08:00
25
.github/workflows/setup/action.yaml
vendored
25
.github/workflows/setup/action.yaml
vendored
@@ -5,6 +5,10 @@ inputs:
|
||||
description: 'Auth token for Docker Hub, required for BuildJet jobs'
|
||||
required: true
|
||||
default: ''
|
||||
cache_key_prefix:
|
||||
description: 'Prefix for caching key'
|
||||
required: true
|
||||
default: 'scons_x86_64'
|
||||
is_retried:
|
||||
description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly'
|
||||
required: false
|
||||
@@ -43,14 +47,19 @@ runs:
|
||||
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: scons-cache
|
||||
uses: ./.github/workflows/auto-cache-restore
|
||||
- id: restore-scons-cache
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: .ci_cache/scons_cache
|
||||
key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
key: ${{ inputs.cache_key_prefix }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}
|
||||
scons-${{ runner.arch }}
|
||||
${{ inputs.cache_key_prefix }}-${{ env.CACHE_COMMIT_DATE }}-
|
||||
${{ inputs.cache_key_prefix }}-
|
||||
# if we didn't get a cache hit, make the directory manually so it doesn't fail on future steps
|
||||
- id: scons-cache-setup
|
||||
shell: bash
|
||||
if: steps.restore-scons-cache.outputs.cache-hit != 'true'
|
||||
run: mkdir -p $GITHUB_WORKSPACE/.ci_cache/scons_cache
|
||||
# as suggested here: https://github.com/moby/moby/issues/32816#issuecomment-910030001
|
||||
- id: normalize-file-permissions
|
||||
shell: bash
|
||||
@@ -58,6 +67,12 @@ runs:
|
||||
run: |
|
||||
find . -type f -executable -not -perm 755 -exec chmod 755 {} \;
|
||||
find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \;
|
||||
- id: setup-buildx-action
|
||||
if: contains(runner.name, 'buildjet')
|
||||
name: Set up Docker Buildx on buildjet to ensure a consistent cache
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver: docker-container
|
||||
# build our docker image
|
||||
- shell: bash
|
||||
run: eval ${{ env.BUILD }}
|
||||
Reference in New Issue
Block a user