chore: Speed up CI (#3711)
This commit is contained in:
+15
-80
@@ -27,70 +27,32 @@ jobs:
|
|||||||
name: Build and Test Rust Project
|
name: Build and Test Rust Project
|
||||||
runs-on: goose
|
runs-on: goose
|
||||||
steps:
|
steps:
|
||||||
# Add disk space cleanup before linting
|
|
||||||
- name: Check disk space before build
|
|
||||||
run: df -h
|
|
||||||
|
|
||||||
#https://github.com/actions/runner-images/issues/2840
|
|
||||||
- name: Clean up disk space
|
|
||||||
run: |
|
|
||||||
echo "Cleaning up disk space..."
|
|
||||||
sudo rm -rf \
|
|
||||||
/opt/google/chrome \
|
|
||||||
/opt/microsoft/msedge \
|
|
||||||
/opt/microsoft/powershell \
|
|
||||||
/usr/lib/mono \
|
|
||||||
/usr/local/lib/android \
|
|
||||||
/usr/local/lib/node_modules \
|
|
||||||
/usr/local/share/chromium \
|
|
||||||
/usr/local/share/powershell \
|
|
||||||
/usr/share/dotnet \
|
|
||||||
/usr/share/swift \
|
|
||||||
/opt/ghc \
|
|
||||||
/opt/hostedtoolcache \
|
|
||||||
/usr/local/graalvm \
|
|
||||||
/usr/local/sqlpackage
|
|
||||||
|
|
||||||
# Clean package manager caches
|
|
||||||
sudo apt-get clean
|
|
||||||
sudo apt-get autoremove -y
|
|
||||||
|
|
||||||
# Clean docker if present
|
|
||||||
docker system prune -af 2>/dev/null || true
|
|
||||||
|
|
||||||
df -h
|
|
||||||
|
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
|
||||||
|
|
||||||
|
- name: Activate hermit and set CARGO_HOME
|
||||||
|
run: |
|
||||||
|
source bin/activate-hermit
|
||||||
|
echo "CARGO_HOME=$CARGO_HOME" >> $GITHUB_ENV
|
||||||
|
echo "RUSTUP_HOME=$RUSTUP_HOME" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev
|
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev
|
||||||
|
|
||||||
- name: Cache Cargo Registry
|
- name: Cache Cargo artifacts
|
||||||
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
|
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: |
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
${{ env.CARGO_HOME }}/bin/
|
||||||
|
${{ env.CARGO_HOME }}/registry/index/
|
||||||
|
${{ env.CARGO_HOME }}/registry/cache/
|
||||||
|
${{ env.CARGO_HOME }}/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-registry-
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
- name: Cache Cargo Index
|
|
||||||
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
|
|
||||||
with:
|
|
||||||
path: ~/.cargo/index
|
|
||||||
key: ${{ runner.os }}-cargo-index
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-index
|
|
||||||
|
|
||||||
- name: Cache Cargo Build
|
|
||||||
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
|
|
||||||
with:
|
|
||||||
path: target
|
|
||||||
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-build-
|
|
||||||
|
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
run: |
|
run: |
|
||||||
@@ -100,32 +62,6 @@ jobs:
|
|||||||
cargo test --jobs 2
|
cargo test --jobs 2
|
||||||
working-directory: crates
|
working-directory: crates
|
||||||
|
|
||||||
- name: Check disk space before cleanup
|
|
||||||
run: df -h
|
|
||||||
|
|
||||||
- name: Clean up disk space
|
|
||||||
run: |
|
|
||||||
echo "Cleaning up disk space..."
|
|
||||||
# Remove debug artifacts that are no longer needed after tests
|
|
||||||
rm -rf target/debug/deps
|
|
||||||
rm -rf target/debug/build
|
|
||||||
rm -rf target/debug/incremental
|
|
||||||
# Clean cargo cache more aggressively
|
|
||||||
cargo clean || true
|
|
||||||
# Clean npm cache if it exists
|
|
||||||
npm cache clean --force 2>/dev/null || true
|
|
||||||
# Clean apt cache
|
|
||||||
sudo apt-get clean
|
|
||||||
sudo apt-get autoremove -y
|
|
||||||
# Remove unnecessary large directories
|
|
||||||
rm -rf ~/.cargo/registry/index || true
|
|
||||||
rm -rf ~/.cargo/registry/cache || true
|
|
||||||
# Remove docker images if any
|
|
||||||
docker system prune -af 2>/dev/null || true
|
|
||||||
|
|
||||||
- name: Check disk space after cleanup
|
|
||||||
run: df -h
|
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
source ./bin/activate-hermit
|
source ./bin/activate-hermit
|
||||||
@@ -156,7 +92,6 @@ jobs:
|
|||||||
run: source ../../bin/activate-hermit && npm run lint:check
|
run: source ../../bin/activate-hermit && npm run lint:check
|
||||||
working-directory: ui/desktop
|
working-directory: ui/desktop
|
||||||
|
|
||||||
|
|
||||||
# Faster Desktop App build for PRs only
|
# Faster Desktop App build for PRs only
|
||||||
bundle-desktop-unsigned:
|
bundle-desktop-unsigned:
|
||||||
uses: ./.github/workflows/bundle-desktop.yml
|
uses: ./.github/workflows/bundle-desktop.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user