Skip to content

Commit

Permalink
fix(ci): change cache & toolchain install (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Sep 6, 2023
1 parent b062e94 commit 855bde4
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.platform.target }}
targets: ${{ matrix.platform.target }}

- name: install webkit2gtk (ubuntu only)
if: contains(matrix.platform.target, 'gnu')
Expand All @@ -38,41 +37,7 @@ jobs:
Invoke-WebRequest https://go.microsoft.com/fwlink/p/?LinkId=2124703 -OutFile installwebview.exe -UseBasicParsing
cmd /C start /wait installwebview.exe /silent /install
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Cache cargo registry
uses: actions/[email protected]
with:
path: ~/.cargo/registry
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}
${{ matrix.platform }}-stable-cargo-registry-
- name: Cache cargo index
uses: actions/[email protected]
with:
path: ~/.cargo/git
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}
${{ matrix.platform }}-stable-cargo-index-
- name: Cache cargo target
uses: actions/cache@v2
with:
path: target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}
${{ matrix.platform }}-stable-cargo-core-
- uses: Swatinem/rust-cache@v2

- name: build wry
run: cargo build --target ${{ matrix.platform.target }}
Expand All @@ -95,4 +60,3 @@ jobs:
contains(matrix.platform.target, 'windows') ||
contains(matrix.platform.target, 'apple'))
run: cargo build --no-default-features --features winit --target ${{ matrix.platform.target }}

0 comments on commit 855bde4

Please sign in to comment.