86 lines
2.5 KiB
YAML
86 lines
2.5 KiB
YAML
name: Cache
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/cache.yml
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_NET_RETRY: 10
|
|
RUST_BACKTRACE: short
|
|
RUSTUP_MAX_RETRIES: 10
|
|
|
|
jobs:
|
|
cache:
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
settings:
|
|
- host: macos-13
|
|
target: x86_64-apple-darwin
|
|
- host: macos-14
|
|
target: aarch64-apple-darwin
|
|
- host: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
- host: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
name: Make Cache
|
|
runs-on: ${{ matrix.settings.host }}
|
|
if: github.repository == 'polyfrost/onelauncher'
|
|
permissions: {}
|
|
timeout-minutes: 150
|
|
steps:
|
|
- name: Maximize build space
|
|
if: ${{ runner.os == 'Linux' }}
|
|
uses: easimon/maximize-build-space@fc881a613ad2a34aca9c9624518214ebc21dfc0c
|
|
with:
|
|
swap-size-mb: 4096
|
|
root-reserve-mb: 6144
|
|
remove-dotnet: 'true'
|
|
remove-codeql: 'true'
|
|
remove-haskell: 'true'
|
|
remove-docker-images: 'true'
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
|
|
|
- name: (windows) - Setup Target
|
|
if: ${{ runner.os == 'Windows' }}
|
|
shell: powershell
|
|
run: |
|
|
New-Item -ItemType Directory -Force -Path C:\onelauncher_target
|
|
New-Item -Path target -ItemType Junction -Value C:\onelauncher_target
|
|
|
|
- name: Setup System
|
|
uses: ./.github/actions/setup-system
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
target: ${{ matrix.settings.target }}
|
|
save-cache: 'true'
|
|
|
|
- name: (debug) - Test
|
|
run: cargo test --workspace --all-features --no-run --locked --target ${{ matrix.settings.target }}
|
|
|
|
- name: (release) - Test
|
|
run: cargo test --workspace --all-features --no-run --locked --release --target ${{ matrix.settings.target }}
|
|
|
|
- name: (debug) - Build
|
|
run: cargo build --quiet --workspace --all-features --target ${{ matrix.settings.target }}
|
|
|
|
- name: (release) - Build
|
|
run: cargo build --quiet --workspace --all-features --release --target ${{ matrix.settings.target }}
|
|
|
|
- name: (debug) - Clippy
|
|
run: cargo clippy --workspace --all-features --target ${{ matrix.settings.target }}
|