on: push: paths-ignore: - "documentation/**" branches: - main pull_request: paths-ignore: - "documentation/**" branches: - main workflow_dispatch: name: CI jobs: rust-format: name: Check Rust Code Format runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Setup Rust uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable with: toolchain: stable - name: Run cargo fmt run: cargo fmt --check rust-build-and-test: name: Build and Test Rust Project runs-on: ubuntu-latest 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 df -h - name: Checkout Code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Install Dependencies run: | sudo apt update -y sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev - name: Setup Rust uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable with: toolchain: stable - name: Cache Cargo Registry uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3 with: path: ~/.cargo/registry key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-registry- - 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 run: | gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' cargo test working-directory: crates # Add disk space cleanup before linting - 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 npm cache if it exists npm cache clean --force || true # Clean apt cache sudo apt-get clean # Remove unnecessary large directories rm -rf ~/.cargo/registry/index || true # Remove docker images if any docker system prune -af || true # Remove unused packages sudo apt-get autoremove -y || true - name: Check disk space after cleanup run: df -h - name: Lint run: cargo clippy -- -D warnings desktop-lint: name: Lint Electron Desktop App runs-on: macos-latest steps: - name: Checkout Code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Set up Node.js uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # pin@v2 with: node-version: "lts/*" - name: Install Dependencies run: npm ci working-directory: ui/desktop - name: Run Lint run: npm run lint:check working-directory: ui/desktop # Faster Desktop App build for PRs only bundle-desktop-unsigned: uses: ./.github/workflows/bundle-desktop.yml if: github.event_name == 'pull_request' with: signing: false