build: remove sas, backup_cache logic

This commit is contained in:
Keeley Hammond
2024-06-12 16:46:46 -05:00
parent 6948c38e15
commit 71f6cd2c52
2 changed files with 7 additions and 41 deletions

View File

@@ -54,7 +54,6 @@ jobs:
options: --user root
volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
- /var/run/sas:/var/run/sas
steps:
- name: Checkout Electron
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
@@ -166,36 +165,20 @@ jobs:
if: steps.check-cache.outputs.cache_exists == 'false'
run: |
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
tar -cvf $DEPSHASH.tar src
tar -cf $DEPSHASH.tar src
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
- name: Move src folder to cross-OS portal
if: steps.check-cache.outputs.cache_exists == 'false'
run: |
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
sudo mkdir -p /var/portal
sudo chown -R $(id -u):$(id -g) /var/portal
mv ./src /var/portal
- name: Persist Src Cache
if: steps.check-cache.outputs.cache_exists == 'false'
run: |
backup_cache_path=/var/portal
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
echo "Using cache key: $DEPSHASH"
echo "Checking path: $final_cache_path"
if [ ! -f "$final_cache_path" ]; then
echo "Cache key not found, storing tarball"
tmp_container=/mnt/cross-instance-cache/tmp/${{ github.sha }}
tmp_cache_path=$tmp_container/$DEPSHASH.tar
mkdir -p $tmp_container
if [ -f "$backup_cache_path" ]; then
tar -cf $tmp_cache_path -C $(dirname $backup_cache_path) ./$(basename $backup_cache_path)
else
tar -cf $tmp_cache_path -C $backup_cache_path/ ./
fi
mv -vn $tmp_cache_path $final_cache_path
rm -rf $tmp_container
echo "Cache key not found"
exit 1
else
echo "Cache key already exists, skipping.."
echo "Cache key persisted in $final_cache_path"
fi
build:
strategy:
@@ -210,7 +193,6 @@ jobs:
options: --user root
volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
- /var/run/sas:/var/run/sas
needs: checkout
steps:
- name: Load Build Tools

View File

@@ -181,34 +181,18 @@ jobs:
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
tar -cf $DEPSHASH.tar src
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
- name: Move src folder to cross-OS portal
if: steps.check-cache.outputs.cache_exists == 'false'
run: |
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
sudo mkdir -p /var/portal
sudo chown -R $(id -u):$(id -g) /var/portal
mv ./src /var/portal
- name: Persist Src Cache
if: steps.check-cache.outputs.cache_exists == 'false'
run: |
backup_cache_path=/var/portal
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
echo "Using cache key: $DEPSHASH"
echo "Checking path: $final_cache_path"
if [ ! -f "$final_cache_path" ]; then
echo "Cache key not found, storing tarball"
tmp_container=/mnt/cross-instance-cache/tmp/${{ github.sha }}
tmp_cache_path=$tmp_container/$DEPSHASH.tar
mkdir -p $tmp_container
if [ -f "$backup_cache_path" ]; then
tar -cf $tmp_cache_path -C $(dirname $backup_cache_path) ./$(basename $backup_cache_path)
else
tar -cf $tmp_cache_path -C $backup_cache_path/ ./
fi
mv -vn $tmp_cache_path $final_cache_path
rm -rf $tmp_container
echo "Cache key not found"
exit 1
else
echo "Cache key already exists, skipping.."
echo "Cache key persisted in $final_cache_path"
fi
build:
strategy: